Yes, convert them to a shared mailbox and them move them to Office 365.
The shared mailbox does not require a license and has a 50GB quota.
Then give yourself full access to those mailboxes once they are moved to Exchange Online.
Its important to concert to a shared mailbox first on-prem before moving
and disable the AD account
https://learn.microsoft.com/en-us/microsoft-365/admin/email/convert-user-mailbox-to-shared-mailbox?view=o365-worldwide
Convert a user mailbox to a shared mailbox