Requires PowerShell to be installed on your PC. Will require installing the signtool which is part of Windows SDK. There are 4 major steps.
Go to partner.microsoft.com/en-us/dashboard/apps-and-games > Select your app > click Product Identity > Copy the Package/Identity/Publisher value.
It should be formatted something like CN=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX replacing the Xs with hexadecimal characters.
Use the New-SelfSignedCertificate PowerShell cmdlet.