This can be done by modifying the .csproj file to automatically include files of a specific template, for example.
<ItemGroup>
<Compile Include="GeneratedPartialClasses\*.cs" />
</ItemGroup>
Please note that Visual Studio will also download these files as part of your project, so you may need to be careful that these generated files are not accidentally checked for source control.