You can violate an act, but that is the same as violating a law which is an act of parliament ( a law passed by parliament). So an act is a statute/law/legal provision.
So you are quite correct when you say committing an infraction in an act ( in a law by going against the specific legal provision).
You can also violate principles,a situation, a place, a person, ethics