Lawyer here! Crime is the general term, and describes any offense against the people or the sovereign. Offenses are divided into severities, ranging from felony (worst) to infraction (least), with penalties to suit.
In this case, swimming on the free beach is probably an infraction, much like failing to use your turn signal. The worst penalty you’ll face in the usual case is a fine. But if you swim on the free beach, get yourself in trouble, and a rescue party has to come save you, the fact that it’s a “crime” now gives the state the ability to recover their costs from you afterwards.