In answer to 'Is [that which is imputed] the only way to keep this law ?'
Those who have believed on Jesus Christ are 'become dead to the law by the body of Christ; that ye should be married to another, even to him who is raised from the dead' Romans 7:4-9 for the old humanity which came from Adam 'was not subject to the law, neither indeed can be' 'because it was weak through the flesh',Romans 8:3 and 7.
The Serpent's temptation, and Eve's deception and Adam's transgression brought humanity under bondage to a means of service which was a way of death and not the supposed life that was promised. It only brought sin and death, did this law, Romans 8:2. For flesh is 'not subject to law nor indeed can it be'.
The death of Christ (note, not his sufferings, prior to death, which relate to sinful acts committed in the body and by the body) the death of Christ, once he was 'made sin' took the old humanity out of the way, through death, 2 Corinthians 5:21.
'The body of sin' (the old humanity under Adam) is 'destroyed' in the death of Christ, Romans 6:6.
Sin in the flesh is condemned and judged and destroyed in the death of Christ. And to such as are crucified with him, the law no longer speaks. They are dead. Justly, accountably, forensically and righteously, dead and no longer under the law which addresses humanity under Adam.
They are lawfully married to another, since the first husband is (in Christ and through the death of Christ) deceased. Romans 7:2 ff.
Hence, 'ye are not under the law but under grace', Romans 6:14. Hence :
I am crucified with Christ: nevertheless I live; yet not I, but Christ liveth in me: and the life which I now live in the flesh I live by the faith of the Son of God, who loved me, and gave himself for me. [Galatians 2:20 KJV]
Striving by a legal means to always think of certain things, under a sense of obligation to do so will be a legal burden and will bring one under a sense of failure and guilt and into a legal bondage.
But, 'the rule (nomos) of the Spirit [of life in Christ Jesus] hath made me free from the rule of sin and death'. Romans 8:2 with my own added square bracket. The rule of the Spirit is that life is in Christ Jesus and not by means of the flesh addressing itself to law.
The commandments of the Lord Jesus in the Gospel are to 'believe on the Lord Jesus Christ' and to 'love one another', 1 John 3:23.
And these commandments are 'not grievous', 1 John 5:3. 'My yoke is easy and my budren is light' saith Jesus, Matthew 11:30.
'Faith works by love', Galatians 5:6 and 'if ye love me keep my commandments', John 14:15 but not the law of Moses and not by a way of works of the flesh attempting to please God in the old humanity received from Adam.
But the eye of faith sees Jesus Christ, believing in love to the Lord who gave himself, willingly, to redeem his people from all iniquity. 'Thou shalt call his name Jesus for he shall save his people from their sins', Matthew 1:21.
Says Paul, 'I had not known sin except the law had said, Thou shalt not covet', Romans 7:7. Then 'sin revived and I died' he says, Romans 7:9. Addressing himself to law, Saul of Tarsus reached a condition which Paul the Apostle describes as 'O, wretched man that I am, who shall deliver me !', Romans 7:24.
But he thanks God for the deliverance that is by Jesus Christ, not by his own efforts in the flesh to keep a law which cannot bring life for it is 'weak through the flesh', Romans 8:3.
The mind, says Paul, Romans 7:25, agrees with the law and respects the law, but the flesh fails and is 'not subject to the law neither indeed can be'. So 'but with the flesh (I serve) the law of sin' Romans 7:25.
Because the carnal mind is enmity against God: for it is not subject to the law of God, neither indeed can be. [Romans 8:7 KJV]
It is faith in Christ which saves. It is faith in Christ which justifies and it will be faith in Christ which sanctifies, Romans 8:30.
Having the 'mind of Christ' is a matter of having the mentality of Christ. We see this expressed in the apostles who wrote epistles, primarily Paul but also John, they both expressing the 'mind of Christ' but in very different ways, John in a profound and intuitive way, Paul more logical and structural, but both expressing divinity in the doctrine of Christ.
It is a way of faith, not of works. It is a way of sacrifice and offering, not of legal commandment. It is a way of salvation, not of self assertion. It is a way of grace not of hopeless bondage. It is a way of honesty not of hypocrisy and pretence. It is a way of confession, not of hiding. It is a way of love, not of selfish ambition.
This mind is exhorted to be in them who follow Christ, that of his mind who humbled himself, who lowered himself, who emptied himself, who gave himself, who suffered for sins not his own, who yielded up his life (no man taking it from him) who sacrificed himself that others might benefit.
This is the mind of Christ.
This is the example to follow, the example of faith which works by love :
Let this mind be in you, which was also in Christ Jesus: Who, being in the form of God, thought it not robbery to be equal with God: But made himself of no reputation, and took upon him the form of a servant, and was made in the likeness of men: And being found in fashion as a man, he humbled himself, and became obedient unto death, even the death of the cross. [Philippians 2:5-8 KJV]
My references, all within quotation marks, from memory, are from the KJV. As I have the time, I shall go through and add the chapter and verse.