Office 365 Teams is built on Office 365 Groups, which include a “shared mailbox” for the members, allthough Groups mailboxes are not the same according to Exchange Online.
Default all these mailboxes get the tenant domain customname.onmicrosoft.com, and I don’t see why anyone would want that, but as long as you can use the global address list, it might not mean that much.
But in case you need to inform anyone about the address to your Teams/Groups, I would suggest using your vanity domain, and we have two options:
1. Create an EmailAddressPolicy for Groups, which will result in all new Teams/Groups to default use the domain you specify.
New-EmailAddressPolicy -Name Groups -IncludeUnifiedGroupRecipients -EnabledEmailAddressTemplates "SMTP:@itiscloudy.com" -Priority 1
2. Create the Groups in Exchange Online Admin Center, where you can choose which domain to be used in the EmailAddress, before you create a Teams connected to an existing Groups.
Some actions isn’t that repetitive to need a script or module, so I haven’t gathered the PowerShell commands to create Groups and Teams yet.