You need a few specific things to do so:
$employee = email address of employee who left the company
$DriveID = team drive (shared drive ID) where you want to move
$gfolderID = create a folder in the Shared Drive (team drive) where you want to migrate all files and folders
Just run this command, replacing variables with the values if you have, if you don't know how to get values for the Shared Drive or the Shared folder, ask in reply or ask Google :-)
- gam user "$employee" copy drivefile root teamdriveparentid "$DriveID" newfilename "$gfolderID" recursive
This command will migrate data with sharing linkage, so all who had access to the files folder will be moved to the shared drive (team drive) also and be able to access from there.