sAMAccountName logic

Hi Team,

we have the below sAMAccountName generator logic. can someone guide me if we have to create it as transform in Identity profile or we have to update it in Create Account page on the AD source? Please provide me the API call to update the Create Account page with the below logic. Any insights would be great help. Thanks in advance.

{
                "attributes": {
                    "cloudMaxSize": "100",
                    "cloudMaxUniqueChecks": "10",
                    "cloudRequired": "true"
                },
                "isRequired": false,
                "isMultiValued": false,
                "name": "sAMAccountName",
                "transform": {
                    "attributes": {
                        "fi": {
                            "attributes": {
                                "begin": 0,
                                "end": 1,
                                "input": {
                                    "attributes": {
                                        "name": "firstname"
                                    },
                                    "type": "identityAttribute"
                                }
                            },
                            "type": "substring"
                        },
                        "fn": {
                            "attributes": {
                                "input": {
                                    "attributes": {
                                        "name": "firstname"
                                    },
                                    "type": "identityAttribute"
                                }
                            },
                            "type": "upper"
                        },
                        "ln": {
                            "attributes": {
                                "input": {
                                    "attributes": {
                                        "name": "lastname"
                                    },
                                    "type": "identityAttribute"
                                }
                            },
                            "type": "upper"
                        },
                        "patterns": [
                            "$fi.$ln",
                            "$fi.$ln${uniqueCounter}"
                        ],
                        "sourceCheck": true
                    },
                    "type": "usernameGenerator"
                },
                "type": ""
            },