A transgression is something that is against a command or law. Whether you are cheating on a test, or cheating on a spouse, you are committing transgressions that are not easily forgiven.
A transgression can be a failure to do your duty. A sin is a transgression against God. The noun transgression is from Middle English, from Middle French, from Latin "act of crossing, passing over," from transgredi "to step or pass over."