After much sturm and drang I finally found that if you change your build arguements to
msbuildArgs: ‘/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=”$(build.artifactStagingDirectory)” /p:AutoParameterizationWebConfigConnectionStrings=false’
And do the the other tips listed on this blog then the web.config files should transform like they are supposed to.