In my view there are two types of laws God has legislated: Covenantal (relative to a covenant, people, place and time) and Trans-covenantal (objectively binding independent of any covenant, people, place and time). The former is particular; the latter is general. The way this is cashed out is that sin can refer to a description or a prescription; but for any formal connotation, it refers to any violation of God's commands in state, disposition, (i.e. internal/intrinsic) and act (i.e. external/extrinsic).
God legislates the law as an expression of his nature, will (i.e. Revealed will/approves or secret will/aim), and character. God is not bound by any laws, since a law entails a lawgiver; rather, He is goodness itself. However, God can issue commands to be bound to them ( i.e. Covenants, promises). Kant provided a helpful distinction between following a rule and acting in accordance to a rule. We are obligated to follow God's laws. God naturally is morally perfect and good thus acts in accordance to the issued laws.