In theory it's really easy, in practice the manpage didn't help me.
Assuming my interface is available because it's supported by default:
# cat /etc/hostname.rtwn0
join 'net name1' wpakey 'secret'
join 'net name2' wpakey 'secret'
inet autoconf
# ifconfig rtwn0 media
# ifconfig rtwn0 scan
# sh /etc/netstart
Notes:
joinworks with several, the oldnwidonly works onceman hostname.if
Reference: https://www.openbsd-desktop.rocks/posts/wi-fi-connection/