At some point, I think it flips from “a genuine tourist” to “an undocumented worker”, but I don’t think it’s easy to tell exactly when, especially if the actual job isn’t a local one.
If I’m on a tourist visa and taking a local job, the country’s documented workers should rightly feel cheated. If I’m on a tourist visa and brought my own job from outside the country, I’m not sure those workers have nearly as much standing to feel I’m cheating them.