You cannot break the link between on-premises user accounts and Azure AD user accounts in groups. Only option is to disable dirsync for entire tenant by using the same command that you have mentioned as below.
Set-MsolDirSyncEnabled -EnableDirsync $False
If you go into Azure AD Connect, and under Domain and OU filtering, uncheck a group, this will delete the group from Azure AD as well. This approach will not suit for your requirement.
Let me know if you have any further questions.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.