Ramsey - It depends upon the law in each town, as towns regulate zoning. It also depends on whether or not someone reports the illegal use. So if you hear a knock on your door and the town attorney, a building inspector and two cops are standing there...Generally, the homeowner will be subject to fines, and you, the tenant would have to move. Usually this happens when nosey neighbors complain. If there are no nosey neighbors, you could live there for years without any issues.
Good Luck with your decision!
PS Usually the landlord claims that you are"family" in an effort to circumvent the illegal use.