That is a feature of the nuget package design. And nuget has the automatic import targets mechanism. See this document.
The tip is that you should name the targets or props file to <package_id>.props or targets and then pack the file into build folder. That is all.
For an example, I created a lib project and then use this nuspec file to pack:
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>test_A</id>
<version>1.0.0</version>
<title>me</title>
<authors>me</authors>
......
</metadata>
<files>
<file src="test_A.props" target="build" />
</files>
</package>
If my package is called test_A.1.0.0.nupkg, the file should be named as test_A.props file.
Then, when you install the nuget package into a new project, you can check the <new project>.csproj file, the props file is added automatically during the nuget installation.

If you use PackageReference nuget management format to install the nuget package, the file is added under obj\xxx.csproj.nuget.g.props or obj\xxx.csproj.nuget.g.targets file:

For new-sdk project, that also work. If you create a new-sdk class library project, you could use this into csproj file to pack it:
<None Include="<packages_id>.props" Pack="true" PackagePath="build">
When you finish it, install the new package into new-sdk main project, you will find that the props file has imported automatically under obj\xxx.csproj.nuget.g.props file.