Many ways to do it. This is one. Assuming you extract the serialNumber from AD.
Create a custom rule to extract and only add the serialNumber to the claim pipeline:
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
=> add(store = "Active Directory", types = ("http://mydomain.tld/claims/2017/06/serialnumber"), query = ";serialNumber;{0}", param = c.Value);
Then do a nested replace of the value in a second custom rule:
c:[Type == "http://mydomain.tld/claims/2017/06/serialnumber"]
=> issue(Type = "http://mydomain.tld/claims/2017/06/serialnumber", Value = RegExReplace(RegExReplace(RegExReplace(c.Value, "^1218719$", "370981128817632"), "^098432224$", "3827699"), "^09843877771$", "434365122"));
You need to have them in this order.