This is already available as an option in the official smartlighting feature. It’s called “mirror behavior.“ It means that when switch A turns on, switch B turns on. When switch A turns off, switch B turns off. The two can be any switches that you like as long as each can talk to the hub.
There is a community FAQ on setting it up:
FAQ: create a virtual three-way using the “mirror“ feature of SmartLighting [NEEDS UPDATING]