Have you checked "Run the script under specified account" for the component?
If not, it will run on Agent node with identity of local SYSTEM account. So it has no access to other domain machine.
When you check the setting "Run the script under specified account:" on, then the PowerShell session will run on agent machine with identity of assigned credential.
Then you can modify the script to not contain -Credential switch:
...
$output=Measure-Command {Copy-Item C:\temp\output.dat -Destination \\$transfer_host\c$\temp} | Select TotalMinutes
rm $lockfile
Write-Host "Statistic:" $output.TotalMinutes
Write-Host "Message: Copy duration [min]"
Exit 0;