There is no OOTB way to connect to the Pi when you're on two separate networks. Your public IP address is that of your modem, and is addressable from the world wide web (for example, we'll say this is IP Address ABC.ABC.ABC.ABC) - this can be masked with a domain name. However when you attempt to contact this IP address from the web this only brings you to your router.
You have to set up port forwarding on your router to access the Pi within the router's network - you would forward any contact on your router at Port X to the IP address of your Pi within the router (let's call this IP PIP.PIP.PIP.PIP) and port 502 (the port the modbus server is on). This doesn't necessarily have to be routed through the internet - if the router that has your pi is sitting within a network that your computer is connected to, then you don't have to go to the publicly facing IP - you can go to the IP address assigned to that router by the "Parent Router," so long as you access that IP address on Port X as you did with the externally facing IP.
Networking is a complicated topic - I'd highly recommend looking into a networking tutorial if you plan on trying to access devices across and between networks as this is a rudimentary, just-enough-to-get-it-working guide.