Gauge violation spectroscopy of synthetic gauge theories