Kinda the same thing with the first murder... there were no commandments at that time but Cain knew he was wrong in murdering Able. God's law has always been in existence even if it wasn't written on stone in the garden lots of implications apparent. With the conversation God had with Cain about the murder....
We can say that all humans since the time of Adam and Eve have the knowledge of Good and Evil.
I think an interesting thing though, is that we don't see the Sabbath being talked about prior to Exodus but we do see lots of other evils happening. Does this mean that even in places like Sodom they were keeping the Sabbath?
Also if we look at cultures around the world, we can find examples in every culture of taboos about murder and sexuality. But I don't think we can find those same taboos about a weekly Sabbath. Though I'm not completely sure, I could be wrong.