Yet they both absolutely transgressed so there must have been a law... They both sinned... Pride and disobedience is sin... Transgression against law. "Do not eat of this tree' is a law.
Let me give you a discernible and easy way to think about dispensations.
1.) From Adam to the Moses = No Law, No Commandments.
This is John 1:17. "the law came by Moses"....so, note that Moses was not in the Garden of Eden.
And note that Moses didn't give the 10 Commandments, because God gave them Himself TO Moses, on 2 Stones.
So, all that explains this verse..."""where there is NO LAW.....there is NO TRANSGRESSION"">.
God tested obedience. He said......"of all the Trees you may eat, but of this one, you may not".....
And God did this because Freewill was in effect.
God didnt create Robots.
He created "in Our Image" free will living Spirits, who are contained in a body.
And John 1:17 applies to the Born again, who are "not under the law"......and that is Roman's 4:8. which teaches you that God does not charge you with your sin, if you are born again.
2.) From Moses to the Cross, you have the Law.
Jesus showed up, not in the "time of the Gentiles", but under the Mosaic Law.
He had to, so that He could fulfill it as God, and this allowed the born again to be : "under Grace"......
3. The Cross until the Great Tribulation. This is the "time of the Gentiles"..., where we are now. Salvation is a Free Gift. Works are not required to be born again. (Saved)
4. The Great Trib till>...... That is coming next. And in it, there will be no "Justification by faith", and many who dont take the "mark", will be martyred, and the rest will have to "endure to the end", and do "works" while they wait.