You may violate Apple's EULA by running macOS on non-Apple hardware, but it's not illegal (it's not a criminal offence).
Violating a contract is not "illegal", but is a civil offense, and requires the other party to sue you to recover damages. Copyright infringement is also not "illegal", but is a civil offense (however, i do believe that a lot of copyright lobbies want to change copyright violations to be a criminal offence, so they won't need to sue, but instead use public prosecution to recover their damages).
> The unauthorized reproduction or distribution of a copyrighted work is illegal. Criminal copyright infringement, including infringement without monetary gain, is investigated by the FBI and is punishable by fines and federal imprisonment. [0]
[0]: https://www.fbi.gov/investigate/white-collar-crime/piracy-ip...