You're not responsible for your ex doing things like lying, possibly cheating etc. She chose to do those things and that's on her.
This. Bingo.
Codepenence is about confusing what is yours to own with what belongs to another person. These actions are choices that your ex made, indeed, cheating and lying is only one of a million possible coping choices once might choose if confronted by a relationship stressor or issue. Her choices belong to HER, not you. When you move into a role of taking responsibility or carrying guilt for someone elses 'stuff', you are getting into confused codependent territory.
Guilt can lead to more CD behaviors because it can come with 'beating ourselves up' and that feels crappy... . so we get our 'fix' from feeling crappy by further embroiling ourselves in messy fix it projects involving other people that really has nothing to do with us... . but it distracts us from our own bad feelings. (guilt, anxiety, etc.)
Don't beat yourself up.
Own your stuff, keep it separate from her stuff... . and when you miss the mark, you are gentle and compassionate with yourself. What purpose does guilt serve other than to feel bad? Wasted energy. Self acceptance and forgiveness when we miss the mark is what spurs growth, not guilt and self punishment and more codependence. Self compassion feels better and is more about self care and self focus and healing. Then, you won't feel so crappy all the time over beating yourself about stuff that isn't yours anyways... . and you won't have to go self-medicate your bad feelings away by rescuing and fixing others 'stuff' anymore.
If I were to ever apologize about my CD (and at times, I have) it would be a sincere apology for not getting out of the person's way and letting that person have full responsibility and deal with the full consequences of
their own choices in life, because my guilt and rescuing instincts just got in the way of that person's own learning/corrective experiences. I wish I'd stepped out of the way more, and turned my attention back to my own life and my own growth, instead of focusing so much on another person.