There are easy commands to view custom/extended attributes of a user account in MSOL and AzureAD PowerShell modules. But there is none available in PowerShell Graph module.
I found a way to see all user attributes with Graph. We have to make a graph call with Invoke-MgGraphRequest command. Here the command:
Invoke-MgGraphRequest -Uri "beta/users/<UserId>" | Format-List
Repace <UserId> with UserPrincipalName of the user.
I piped the command to “Format-List” to see the full attribute name. The On-premises sync custom attributes are very long.