This is a guide to flashing the nRF5340 Application core with an ST-LINK V2 over SWD. Sadly flashing the network core doesn't work with the ST-LINK.
Installing software
You can use the ST-LINK V2 or V3 to flash the nRF5340 using pyOCD. Though I've only tested it with an ST-LINK V2 clone.
So install pyOCD. If you're on Linux, you may need to install the udev rules as well, or pyOCD won't recognize your probe. Reconnect the ST-LINK after installing the udev rules.
After installing pyOCD, you need to install the nrf53 pack.
pyocd pack install nrf53
Flashing
Connect the power and SWD pins an run this command to flash your hex file.
pyocd flash ./zephyr.hex -t nrf5340_xxaa -e auto -O auto_unlock