When transferring the OS, you are required to give the recipient ALL the accompanying info.
License key, COA, etc, etc.
How you do this depends greatly on where the license came from.
If the original OS was preinstalled on the system, then it will transfer with that system. Do a FULL wipe and reinstall, and donate/sell.
If it is an OS that you purchased on its own, you are required to give the new owner all the documentation that it came with.
Again, do a FULL wipe and reinstall before it leaves your hands.
Alternately, install a Linux OS on it, and let the new owner figure out the future OS and licensing.