Hi Nikola,
Do you have verified custom domain name in Azure AD? If yes you can use the configuration of UPN in the AAD Connect and check the settings over here - https://learn.microsoft.com/en-us/azure/active-directory/hybrid/plan-connect-userprincipalname
Hope this helps.
JS
==
Please Accept the answer if the information helped you. This will help us and others in the community as well.