There are some painful traps where I learned about this, like a train ride along the Côte d'Azur (France, EU), with a short stop in Monaco Station (not EU). Or a ride along the border of Switzerland, with your smartphone occasionally logging into their networks.
Sadly, carriers do not seem allow to disable roaming for non-EU networks.
There are some alerting apps that allegedly get triggered by logins into non-EU networks, but they did not seem to work for me and were littered with trackers. Alerts won't help anyway, since it takes only seconds for roaming charges to build up.