Against the licence != illegal, depending on where you are in the world. In most EU countries, if you show the receipt of purchase for a stand alone copy of OSX, you can install it on anything you like legally,EULA prohibiting that would never stand up in any European court.