In modern terms, cheating generally means having a relationship with another lover. I'm not going to say seeing a Prostitute is not considered cheating; but the matter that it is generally illegal has put a different tone on it.
When prostitution was legal, did the definition of cheating have a different meaning?
If you're talking about pre-1900s, it wasn't about cheating so much as traditionally accepted gender roles. That is to say, what a man did outside his home was not the concern of his wife. While not the choicest historical material, there's the line from "Gone with the Wind" that comes to mind. One of the rowdy young men (the red-haired twins from the beginning of the book) says something along the lines of "having a bad girl to have fun with, and a good girl to marry."
This idea is pretty much an indication of where prostitution stood for the "typical" man (whatever you want that to mean). Having sex was something for fun, and not exactly the realm of the wife. Remember that wives were typically pregnant and/or with young children. If a woman didn't care to be saddled with another pregnancy, then she may "refuse" her husbands advances, and it was not her place to question what her husband may or may not do as a response.
While my expertise is not in the US, I did write a dissertation about prostitution in the UK during the 1800s, and can speak a little more clearly to that. Basically, the idea of sex with a prostitute being "cheating" did not exist. During the 1800s in the UK, prostitution was rampant, and while disdained by "high" culture (meaning you didn't talk about it in polite company), prostitution was very much a part of life from the high to the low. While the British were never able to get a number on the actual number of prostitutes at any given time (estimates would range from 8,000 to 80,000), one thing is certain--it was plentiful, cheap, and available. For an upper-middle class married man, sex with a prostitute was your prerogative, and unless your wife could somehow prove some severe abuses (remember the Matrimonial Act didn't pass until 1857), divorcing on grounds of what we would call "cheating" with a prostitute was preposterous.