Having done exactly this myself I found the eaiest way to migrate the licence safely, was to first assoicate your account with a microsoft account (i.e. hotmail, outlook.com, xbox, etc).
How to do this is explained here: Microsoft Insider Blog on Microsoft Accounts in windows 10
Basically:
- Start Menu
- Settings
- Accounts
- Select your account
- Select 'Connect to Microsoft Account' and sign in with your account details.
Once you've done this, it links the licence key of the windows you're using, to your account.
Next proceed with your install of your new ssd, install windows as normal and when it asks you for the 'CD Key' - just choose the box which states something like 'I dont have the key right now'.
Once you've finished the setup, gone through the tutorials etc, you can repeat the above steps, sign into your microsoft account again, and then it'll check and use the licence.
If you want to double check it's got the key, just to go the settings -> system and look for the activation message.