The term "legal" is a bit arbitrary. Once you secede, by definition, you are no longer subject to the laws of the country in which you previously "resided." Of course, if the country that you are breaking from objects, then, according to them, your actions are illegal. By this definition, then, every independence movement in history was illegal.
As far as I know, the Constitution says nothing about secession. It was created, however, in order to form a "more perfect union." Under the previous Articles of Confederation, almost all of the governing powers were with the individual states. Clearly, the Constitution tried to rectify that, and it was designed to lessen the possibility that the country would disintegrate. So I guess you could argue that it is an "anti-secession" document.
Even though our country was founded by secessionists, you can't very well have people declaring independence whenever the heck that they want to. The founding fathers recognized that "treason" should only be turned to as a last resort. Here is a hub that I wrote about the Civil War and of how history may have gone differently if the South had been allowed to secede: