After reading through some documentation I found that adding a file in the same folder as the solution called Directory.Build.props with theses contents disables the telemetry settings:
<Project>
<PropertyGroup>
<AppxLogTelemetryFromSideloadingScript>false</AppxLogTelemetryFromSideloadingScript>
</PropertyGroup>
</Project>