You are correct that the context of the quotation is a discussion of baptism, but we may generalize from this a principle which is true outside baptism as well. Participation in the sufferings of Christ is a common theme throughout Paul’s epistles. For example,
yet so, if we suffer with him, that we may be also glorified with him (Romans 8:17). This is very patristic. Consider Thomas Aquinas’s explanation of why baptism should not take away all the temporal effects of sin.
Baptism has the power to take away the penalties of the present life yet it does not take them away during the present life, but by its power they will be taken away from the just in the resurrection when “this mortal hath put on immortality” (1 Corinthians 15:54). And this is reasonable. First, because, by Baptism, man is incorporated in Christ, and is made His member, as stated above (3; 68, 5). Consequently it is fitting that what takes place in the Head should take place also in the member incorporated. Now, from the very beginning of His conception Christ was “full of grace and truth,” yet He had a passible body, which through His Passion and death was raised up to a life of glory. Wherefore a Christian receives grace in Baptism, as to his soul; but he retains a passible body, so that he may suffer for Christ therein: yet at length he will be raised up to a life of impassibility. Hence the Apostle says (Romans 8:11): “He that raised up Jesus Christ from the dead, shall quicken also our [Vulgate: ‘your’] mortal bodies, because of His Spirit that dwelleth in us [Vulgate: ‘you’]”: and further on in the same chapter (Romans 8:17): “Heirs indeed of God, and joint heirs with Christ: yet so, if we suffer with Him, that we may be also glorified with Him.”
newadvent.org/summa/4069.htm#article3