I don't have wireguard app installed and hence not familiar with it.
I use a VPN that supports the wireguard protocol and can control this in macros using UI integration method.
I expect this method could be used on the wireguard app.
You can't control WG directly (macrodroid does not ask for the permission to control WG and the permission is needed). Luckily there is a workaround: install this tool (Tasker app is not needed) and use it as a bridge to redirect intents to WireGuard. APK is found in app/release folder.