From the second chapter of Genesis, God is laying down the law and yet, there is no sin. The first time law is brought up is effectively first use of the law, the civil use. God gave this law when he told Adam not to eat from the tree of the knowledge of good and evil. Though generally given by governments, this use is correct in that at that time, God was the local governing body and this law was preventative in that it kept Adam from sin.
However, the law used in the rest of the chapter has more to do with vocation. This is first revealed to us when God says that Adam needs a helper. If one has no work, one needs not help. What did Adam need help with? Tending the garden of course. In fact, that’s exactly what Genesis says man was created for. Groundskeeping. (NOTE: I HAVE JUST FREAKED MYSELF OUT AS I FEEL THAT I MAY HAVE JUST ACCIDENTALLY DISCOVERED THE MEANING OF LIFE. IF THE MEANING OF LIFE IS NOT GROUNDSKEEPING, PLEASE SOUND OFF IN THE COMMENTS SO THAT I CAN REST EASY.) Adam was also tasked with naming all the animals. Also, when is helper, Eve, was finally created from his rib, they were tasked with making children.
So to recap, Adam was given the vocation of groundskeeper, beast namer, husband, and father. All before Genesis 3. He was also given specific instructions no to eat from the tree of the knowledge of good and evil. So you can see, the law didn’t come around when Moses came along. Law was there from the beginning. And this law established vocation.
EDIT: I HAVE BEEN CORRECTED VIA FACEBOOK. I LEAVE MY POST AS IT ORIGINALLY WAS POSTED, BUT I ADD THIS SCREENCAP FROM MY CONVERSATION ON FACEBOOK.