Is there any way to set network preferences per Wi-Fi connection? I work on multiple physical locations with different Wi-Fi's to connect to. Certain Wi-Fi's are within local networks that have specific network settings. I have added different "Locations" in the network preferences but those need to be changed manually as it's not attached to a geo location or a specific connection.

I was wondering if there's any way to automatically update my network settings (eg. proxy settings) based on which Wi-Fi I'm connected to...so that when I switch to a different network I also switch network settings?
The locationchanger commandline tool allows changing the macOS Network Location setting according to Wi-Fi SSIDs.

Basically, after installing, you create Location settings in the Network preferences with the same name as the Wi-Fi SSIDs you connect to. The tool then changes the network location setting according to the connected Wi-Fi network SSID.
If no matched name is found, it falls back to the "Automatic" network location setting.

See https://github.com/eprev/locationchanger for download and usage instructions.

It even supports advanced features like running scripts when a specific Wi-Fi network is connected. Please see here for more info on that: https://ruimarinho.github.io/post/automating-network-location-switching-on-macos/