I know there were laws passing anti-Semitism in Nazi Germany, but was the Holocaust in itself legal?
This actually subdivides into two separate questions:
a) Was the setup of large scale political prison camps as a precursor to later mass execution legal, and
b) was the mass murdering itself legal by either international or domestic law?
The first is easy to answer: Yes, as nations are free to determine how they set up what is legal, and how their prison system works (which is btw why the Nazi administration very quickly just added the political prisons into the "civilian legal" prison network -- the initial prison houses randomly set up by local brownshirt leaders were declared legal after the fact with a stroke of the pen). The fact however that they did try to keep it within a certain amount of international legal standards initially goes to show that the law could be bent quite a bit. In Hamburg for instance they set up a prison ship and put it into the international waters of the harbor, for on ships continental regular law does not apply the same way and a captain is supreme judge aboard a vessel. So, lip service was paid to legal requirements where necessary and convenient.
But for the second question, the answer is in short, no -- for one simply due to the fact that the majority of the victims were executed in mass shootings on the killing fields of Eastern Europe. The Geneva convention, of which Germany was a signatory, forbids this.
However, Nazi Germany basically constructed for itself legal loopholes to claim to its own officers why what they were doing was covered (please bear in mind the following is a cynical legal explanation from the standpoint of Nazi mentality):
The killing of non-state-actors (i.e. resistance members or guerrilla groups) is not covered in the Geneva convention, and Nazi propaganda blamed "the Jews" for the war (i.e. an "international Jewish conspiracy" allegedly lobbying France and UK to declare war for the invasion of Poland, which was according to Nazi propaganda an "act of self-defense" and not a war of aggression. The German public, however, knew and understood quite well instinctively what the attack on Poland was.) Furthermore, the Soviet Union was not a signatory to the Geneva convention, and therefore the Nazi regime internally claimed that neither German prisoners in the SU nor Soviet prisoners in German controlled territory were under protection of the convention, and therefore did not have to be treated with such. (This btw is a fallacy -- if you sign the convention you are required to treat even third countries' soldiers with the rules -- but Western prisoners of war from Geneva convention nations did have a much higher chance of surviving incarceration by the Nazi regime than Soviet soldiers).
Note, however, that all this also completely circumvents the question of why a Geneva convention signatory state mass executes civilians who are clearly not members of enemy combatant groups. The Nazi regime would always have claimed that their actions were legal as all the civilians murdered were to be considered "irregular enemy combatants". But they themselves were quite aware this was purely a rhetorical sham.
The SS itself actually tried to hide the mass murdering in the camps as much as they could; letters to family members of camp inmates would regularly be told lies about how their relatives had died in the camp into the early 1940s (an often used story was "shot during escape attempt") to give the killing a legal fig leaf -- which shows that the SS leadership itself was quite aware that the practice of the camp system and the killings as such were not following international norms. They knew what they were doing was against international legal standards even though a cynical and shady legal defense and legitimation could be constructed in theory.
I hope that helps clarify things a bit.