Is energy always conserved?

"Laws are changing during time" is a bit strange thing from philosophical or even mathematical point of view. How do we actually define laws? If we define them as rules which exist outside of the system (the Universe), than they are static and not change at all, but instead they define behavior of the universe such that some things change (for instance "law outside the universe" could define, that gravitational constant G decreases over time, or that energy sometimes isn't conserved).