It's not really illegal as long as you purchased a Mac OS X license, right? The most illegal part would be if you download the hacked OS X from the web.
I believe it is illegal to install OS X on hardware that is not licensed by Apple, though I am not sure where I heard that. Maybe it's in the OS EULA? Who reads those anyway.
Maybe someone can correct me? The above may not be right.