Hi Gamefan!
Nope, that is not illegal. You can sell a game to someone else, licensekey included of course.
But you'd have to unregister and uninstall the license key(s) and software completely and thus never use it again yourself in any way and make sure that the new owner can register his key(s).
Then the new owner can use the game just like you did before, and there is still one user, with one pc, and that is okay as far as the EULA goes.
Regards,
Fred