If you purchased from the Serif Affinity Store, then you can recover your Product Key from your account there: https://affinity.store/account/downloads
If you purchased from Apple's Mac App Store (MAS), you do not need a license code. Your license is tied to your Apple ID. Just login to the MAS on the new computer using the same Apple ID, and you should find all your previous purchases available to install on your new computer.