It comes through trust. Not “imputed” but actually having the unimpeded and radical trust Jesus had, and walking in the Spirit. And until then, why would you have to insist you had some “imputed” something other than forgiveness and being led by the Spirit?
Philippians 3:4-11 KJV
4) Though I might also have confidence in the flesh. If any other man thinketh that he hath whereof he might trust in the flesh, I more:
5) Circumcised the eighth day, of the stock of Israel, of the tribe of Benjamin, an Hebrew of the Hebrews; as touching the law, a Pharisee;
6) Concerning zeal, persecuting the church; touching the righteousness which is in the law, blameless.
7) But what things were gain to me, those I counted loss for Christ.
8) Yea doubtless, and I count all things but loss for the excellency of the knowledge of Christ Jesus my Lord: for whom I have suffered the loss of all things, and do count them but dung, that I may win Christ,
9) And be found in him, not having mine own righteousness, which is of the law,
but that which is through the faith of Christ, the righteousness which is of God by faith:
10) That I may know him, and the power of his resurrection, and the fellowship of his sufferings, being made conformable unto his death;
11) If by any means I might attain unto the resurrection of the dead.
You've added, "and walking in the Spirit". While we have different concepts of what that actually refers to, in context of this discussion, however you see "walking in the Spirit", you are adding a performance requirement that the Bible does not add.
Paul says, "the righteousness which is of God by faith", you are saying, "the righteousness of God which is by walking in the Spirit, and we walk in the Spirit by faith".
I don't have to insist on anything but whatever the Bible says is the truth, so we work towards determining that.
Much love!