You can add envinronment variables(system variables) to change default location of nuget package. For this add(if your system do not have it otherwise edit that) NUGET_PACKAGES system varible into your system environment variables as bellow images.
Then you can test it with this cli command:
dotnet nuget locals -l all
As bellow image global-package must be change to your new location.