The free version of Windows 10 is locked to the PC. You probably won't mind if you have an OEM version of Windows 7 or 8 but you might if you have a retail version.
Not my experience.
I had an OEM Windows 7, later upgraded to 8 (carried the OEM License) then upgraded to 10 when the upgrade offer started.
I just swapped motherboard and CPU a few weeks ago. Rebooted off the same hard drive, the system found and installed the drivers for mobo et al. and activated via digital entitlement when I signed on to my Microsoft account. Still activated, running happily on a different motherboard.