This is presuming the WireGuard has been installed on the EdgeRouter, either by updating it to EdgeOS 3.0 (currenly EA) or by installing WireGuard manually.
Generate the key pair for the router
mkdir /config/auth; cd /config/auth
wg genkey | tee privatekey | wg pubkey > publickey
mv privatekey wg.key
mv publickey wg.pub