It will depend on the domain trust mode (two-way or one-way), but this topic is covered under Using People Picker with multiple forests or domains and Configure People Picker (SharePoint Server 2010).
A couple notes on this:
The user object must be disabled in the source or destination forest. It is not supported to be enabled in both, and with the User Profile Sync Service, you may see unexpected migration activity within SharePoint if it is enabled in both forests.
SharePoint servers cannot be moved between domains/forests. You must build a new farm in the target forest and perform a database migration for service applications and content databases.
Here's the full process:
$wa = Get-SPWebApplication https://url
$adsearchobj = New-Object Microsoft.SharePoint.Administration.SPPeoplePickerSearchActiveDirectoryDomain
$adsearchobj.DomainName = "contoso.com"
$adsearchobj.ShortDomainName = "CONTOSO" #Optional
$adsearchobj.IsForest = $true #$true for Forest, $false for Domain
Do this for each forest and Web Application.
When you move a user object from one forest to another, find a site collection URL where the user object exists and run:
$user = Get-SPUser https://siteCollUrl
Move-SPUser -Identity $user -NewAlias 'i:0#.w|newdomain\username' -IgnoreSid
You can also run:
stsadm -o migrateuser -oldlogin 'i:0#.w|olddomain\username' -newlogin 'i:0#.w|newdomain\username' -ignoresidhistory