You can add a Powershell script task in your build definition to do this. A simple script for your reference:
$changesetid = $Env:Build_SourceVersion
$TFSURI = $Env:System_TeamFoundationCollectionUri
$tfs = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($TFSURI)
$vcs = $tfs.GetService("Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer")
$cs = $vcs.GetChangeset($changesetid)
foreach ($change in $cs.Changes)
{
$change.Item.DownloadFile('D:\a\test\' + $change.Item.ServerItem.Substring(1))
}
This code just get the changed items, if the changeset includes other changes like deletion, you may need to add code to check this.
And you also need to import the TFS Client Library to use this script, refer to this link for details: PowerShell and TFS: The Basics and Beyond.