Yes.
However, if it's a Retail copy, then you can legally transfer it; if it's an OEM copy it's technically against the Windows ToS to transfer an OEM license. The Windows 10 upgrade keeps the license that you had for your original OS.
If your license is retail...you should just be able to create an installer from Microsoft's Media Creation Tool from their Windows 10 download page, and then install it on the new computer. When asked for the serial, enter your Windows 8 serial.