The PIDKEY property stores the serial number. You can set it so the field contains it too.
You can do a registry search to retrieve the serial number from the registry, then use a Property Set with Formatted custom action to set the PIDKEY property to the result.
In the Dialog Editor (in an Enterprise project), on the UserRegistrationDlg select the existing masked edit in which the user places the serial number.
On it, create a new control condition
that will disable the control if the PIDKEY was already found in the registry.