How to download legally OSX if you don't have formatted Mac
You can download any Apple software directly from the Developer portal: https://developer.apple.com/downloads/index.action

Not sure if the site is accessible to non-developers.