It is supposed to follow you Microsoft account. When you are installing Windows and it asks for your windows key, just click (I do not have a windows key) and follow the rest of the prompts. In theory your key will be activated after you connect to internet and you log into your Microsoft account.
I did this recently. I had an FX 6300, 970m Pro3, gt 710, and upgraded to 3rd gen Ryzen, x570 board, 1660ti.
I had previously upgraded my storage to a Crucial MX500. I had no issues with my storage. All I did was clone my HDD to my SSD and it worked fine. When I did the major upgrade all I did was change the hardware. I did not do a clean install. everything worked fine, just standard removal and update of drivers. As for the windows key, I did have to call Microsoft. I did all the troubleshooting I could, and windows prompted me with a phone number to call. I spent about 15 minutes on the phone to get them to activate my key again. Which was not so bothersome considering I have zero hardware left over from my original build.
Now I will say this. Since the major upgrade, I did perform a clean install, but for a different reason. I had a windows log in password set up, and I tried entering safe mode to troubleshoot (windows stuck on restart). I could not enter windows and found on the forums the only was to fix this issue was to do a clean install, which is what I was trying to avoid by going into safe mode.
With my current installation I am not using a log in, in-case I do need to enter safe mode in the future. The clean install removed any programs or drivers that were causing the (stuck on restart) issue to begin with. I installed by using the (I do not have a windows key) prompt. My hardware was recognized and my windows key activated automatally when I connected to the internet. I have had no issues since.