2 Peter 3:17-18 You therefore, beloved, knowing this beforehand, take care that you are not carried away with the error of lawless people and lose your own stability. 18 But grow in the grace and knowledge of our Lord and Savior Jesus Christ. To him be the glory both now and to the day of eternity. Amen.
The above verses contrast growing in grace with being carried away by the error of lawless people. In Psalms 119:29, David wanted God to be gracious to him by teaching him to obey His law. In Titus 2:11-14, our salvation is described as being trained by grace to do what is godly, righteous, and good, and to renounce doing what is ungodly, which is what God's law was given to instruct how to do. In Romans 1:5, we have received grace in order to bring about the obedience of faith. Strong's defines “grace” as "the divine influence upon the heart, and its reflection in the life" and when God's will is reflected in our lives, it takes the form of obedience to His law (Psalms 40:8). So grace is the power of God to overcome lawlessness in our lives and God graciously teaching us to obey His law is itself part of the content of His free gift of salvation.
In 1 John 2:3, those who say that know Christ, but don't obey his commands are liars and the truth is not in them, and in 1 John 3:4-6, sin is defined as the transgression of God's law and those who continue to practice sin have neither seen nor known him. In Matthew 7:21-23, Jesus said that he would tell those who were workers of lawlessness to depart from him because he never knew them, so obedience to God's law is what it looks like to grow in grace and in the knowledge of our Lord and Savior Jesus Christ.