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.
You could replace the innards of a PowerMac or whatnot with a modern system, and it would still be "Apple-branded".
It's just occurred to me that Apple's move away from the x86 platform has pretty much signed the death warrant of the Hackintosh.
The Hackintosh has been de facto dead for years, yeah. It's going to be worse now that they are moving to their super proprietary ARM stack