During execution, the groups are copied from metadata to SharePoint Online. During this process, SharePoint Online becomes the authorizing source for the taxonomy group. For example, the logon data for the process can be stored in a variable beforehand. Afterwards the copying is done with the following command:
$credential = Get-Credential Copy-SPTaxonomyGroups -LocalTermStoreName "Managed Metadata Service Application Proxy" -LocalSiteUrl "https://sharepoint" -RemoteSiteUrl "https://contoso.sharepoint.com" -GroupNames "Group1","Group2" -Credential $credential
This command copies the two groups “Group1” and “Group” to https://contoso.sharepoint.com. If you also want to use the content types hybrid, you can use the Cmdlet Copy-SPContentTypes:
Copy-SPContentTypes -LocalSiteUrl http://localsite/ -LocalTermStoreName "managed metadata service application proxy" -RemoteSiteUrl https://contoso.sharepoint.com/ -ContentTypeNames @("ContentTypeA", "ContentTypeB") -Credential $credential
Microsoft describes the detailed procedure in the SharePoint documentation.
To stop replication between environments, use the Cmdlet Stop-SPTaxonomyReplication.