You could purchase a DVD containing MacOS, but calling them "legit" (as far as installing on a Hackintosh) is a stretch. You're paying for the physical disc, not a license to the OS. The only way to get a license to use MacOS is to purchase a Mac.
To elaborate on this: Apple's license only permits installing Max OS X/OS X/macOS on "Apple branded" computers, so it's technically illegal to install it on Hackintoshes, no matter whether you bought the OS or not.