Shared mailboxes don't require an Office 365 licence. But to avoid any Microsoft weirdness after migrating a Shared mailbox to Office 365, check its licensing status via MSOL PowerShell:
Get-MsolUser -UserPrincipalName email@example.com |fl *lic*
Both IsLicensed and LicenseReconciliationNeeded should be False.
If LicenseReconciliationNeeded is True, fix e.g. try assigning and removing a license, or converting mailbox to User and back to Shared. Otherwise, if LicenseReconciliationNeeded stays True for 30 days the mailbox will be removed.