Violation of any ordinance, rule, or regulation enacted by the board relating to the nonpayment of a fare on any transit vehicle or in any transit station owned, controlled, or used by the board shall be an infraction punishable by a fine not exceeding seventy-five dollars ($75), except that a violation by a person, after the second conviction under this section, shall be a misdemeanor punishable by a fine not exceeding five hundred dollars ($500) or by imprisonment in the county jail not exceeding six months, or by both the fine and imprisonment.