How can I add a WiFi network ahead of time?
You can only "pre-define" WiFi access using Apple Configurator.
Create a profile, configure the WiFi payload with SSID/password and "Auto Join" enabled.
Then install the profile to the device. It should now connect automatically to an access point with the given credentials.
https://help.apple.com/configurator/mac/2.3/#/cadbf9e6ff