The only supported way to do this is to disable dirsync, clear the sourceanchor for any objects you don't want to sync anymore, re-enable dirsync. If you dont care about the supported bit, a faster/easier method is to delete the object in Azure AD, then recover it from the recycle bin. This effectively makes it a "disconnector" and can now be managed directly in Azure AD. Again, not a supported solution though.
Azure Active Directory Connect need to stop synchronization

Hi All,
I need to break the join between my Onpremise AD and Azure AD for the sharedmailbox objects and stop synchronization of this object through AAD connect. We have planned to manage the haredmailbox objects in cloud itself. So we have removed immutableID in On-premise AD which match the values with Exchange online to break the sync. Our AAD connect sourceanchor is ms-ds-consistencyguid which shows join in our AAD connect Synchronization engine. If I remove the ms-ds-consistencyguid or uncheck the OU of the on-premise for the object , then it will get delete from Azure AD or it will disconnect.
Thanks in Advance