Earlier in Galatians (5:17), Paul contrasts the desires of the flesh with the desires of the spirit:
For the desires of the flesh are against the spirit, and the desires of the spirit are against the flesh; for these are opposed to each other, to prevent you from doing what you would.
Some versions capitalize spirit here, implying that spirit refers to the Holy Spirit, but I don't think that's what's exactly intended. I believe that spirit is that constituent part of man that Paul refers to in 1 Thessalonians 5:23:
May the God of peace himself sanctify you wholly; and may your spirit and soul and body be kept sound and blameless at the coming of our Lord Jesus Christ.
One Byzantine commentary on Galatians 5:17 explains:
By flesh he does not mean the body, but rather, earthly, negligent, and lax thoughts. And by spirit he does not mean the soul, but a spiritual attitude to the earthly. What he is describing is not a battle between soul and body, but the contest between good and evil thoughts.1
In this context, Paul can be understood to be addressing your spirit in Galatians 6:18 as the spirit in contrast to the flesh. The same commentator explains:
Note that Paul did not say "with you," but with your spirit. He did so to lead them away from carnal thoughts, which are opposed to the Spirit.2
1. Theophylact of Ohrid, Explanation of the Epistle to the Galatians (tr. from Greek, Chrysostom Press, 2011), p.72.
2. Ibid., p.81-82