Imagine--if humans were made righteous as God is righteous, they would no longer need the Law, would they? The Law would be an encodification of their character as it is an encodification of God's character (or at least some of his communicable attributes). Humans who were transformed in this way would relate to the Law differently from those who were not transformed.
Two illustrations of this new relationship to the Law are the 1) Adolescence and 2) Glorification illustrations.
1 Corinthians 13:8–12Scripture aptly provides this illustration in plain terms. When children grow up, they no longer need what they once did. Consider that you hovered over your child for the first decade of his or her life, dictating rules of all sorts for your child to follow. Some of these rules were simply wisdom and training in the best ways of life. Others regarded matters of life and death. Still others were moral rules about what was right and wrong. At some point, you will no longer be there to enforce those rules. At some point, you will hope that the child will do what is best, what is safe, and what is right all on his or her own with no one telling them what to do. You hope that the rules have made their way from you, an external authority, into who they are as human beings. If they have, then your children--all grown up now--no longer need the rules in the same way they did when they were children. They set their own alarms and get up when it rings, dress themselves, work eight hour days, act ethically, treat others with dignity and respect. Ideally they have matured into adulthood, and they no longer need you over their shoulders constantly telling them what to do.
 Love never ends. As for prophecies, they will pass away; as for tongues, they will cease; as for knowledge, it will pass away.  For we know in part and we prophesy in part,  but when the perfect comes, the partial will pass away.  When I was a child, I spoke like a child, I thought like a child, I reasoned like a child. When I became a man, I gave up childish ways.  For now we see in a mirror dimly, but then face to face. Now I know in part; then I shall know fully, even as I have been fully known. (ESV)
The Glorification Illustration
 “Behold, the days are coming, declares the LORD, when I will make a new covenant with the house of Israel and the house of Judah,  not like the covenant that I made with their fathers on the day when I took them by the hand to bring them out of the land of Egypt, my covenant that they broke, though I was their husband, declares the LORD.  For this is the covenant that I will make with the house of Israel after those days, declares the LORD: I will put my law within them, and I will write it on their hearts. And I will be their God, and they shall be my people.  And no longer shall each one teach his neighbor and each his brother, saying, ‘Know the LORD,’ for they shall all know me, from the least of them to the greatest, declares the LORD. For I will forgive their iniquity, and I will remember their sin no more.” (ESV)
Someday the Law will be written on our hearts in a way that makes the Law-written-in-stone irrelevant to us. Just as God-in-the-Camp became God within our hearts, the Law will become completely who we are. Imagine the day when we are completely glorified, restored to our resurrected bodies, living in the New Heavens and Earth. In that day, everyone will be what the Law describes, and they will no longer need the description. They will not be taught about God or his Law. They will already know God, and his Law will be built into who they are as human beings.
Do you think the saints in heaven need the Law hanging over their heads to be righteous? Doesn't Scripture present a picture of glorified saints who have been fully sanctified? Not only declared righteous, but made righteous? Their relationship to the Law has been changed. The Law no longer describes a righteousness that exists outside of them. They are that righteousness. The Law on the outside has become, fully and completely, love in the inside. The Law remains holy, and righteous, and good. But honestly, at that glorified point, who needs it?!
So when God regenerates people, he changes their relationship to his Law. No longer does his righteousness exist as an impossible standard external to them. No longer is their ability to meet that standard handicapped by slavery to sin. Now they have been set free, transformed, made new. Law has been moved from its position external to them to a position within them. On the inside, it takes the form of love, and love begins to be the both the measure of and motivation for their righteousness. Eventually, the external letter of the Law will be moot, completely replaced by an inerrant and immutable law of love on the inside.
But this change is not now complete. We are still in a transitional stage, still "in the body" in some sense, and will be until our glorification. Original sin has been dealt a death blow; but we still struggle with remaining sin. We are completely justified--declared righteous--which holds our place in the love of God, kind of like a down payment of what is to come. But we are not yet fully sanctified. We are not yet what we will one day be.
Nevertheless, our hearts are being changed, and the more they are changed, the more our relationship to the Law changes. We are to serve in the new way of the Spirit, not in the old way of the written code (Romans 7:6). Legalism is what happens when we regress to the old way of the written code, even while we are supposed to be moving forward to to the new way of the Spirit. Check out this previous post for some questions to help you determine which way you are going.