I'm another one who cheated on my husband in the early years of our relationship, before we were married. I have never told him and never would because it would only hurt him and possibly destroy our relationship which is wonderful.
In my case I had a break down in my early 20''s due to multiple stressful events in my life all piling in on me. Its not an excuse but I behaved very out of character for a few months and one thing was that I became attracted to a man who also had mental health issues I think because I felt he could understand or help me in some way. We didn't actually have sex but we did have sexual contact which was very degreading to me and in retrospect I can see was coerced by him at a time when I was very unwell.
I was mortified it ever happened. I've kept the whole thing a secret for many, many years now. Unfortunately the man involved lives locally to me and I still have to see him several times a year which is horrible and I do worry he might say something one day but I think he also knows that he did coerce me and knows its for the best for him if he doesn't say anything. However you look at it its really horrible and probably my darkest time.
Having said all that I don't think about it every day, when i do I cringe but then try to put it out of my mind. The experiance I had led me to eventually seek help for the acute distress I was in and start to recover as opposed to suffering in silence and trying to self medicate in extreme ways.
When I do think about it I cringe and sometimes I have a wee cry but mostly I am able to just put it in perspetive and out of my mind. It was a bad thing that I did and that happened to me but I was very young, I was unwell and I was just trying to figure things out however poorly at a time I had very few resources. It isn't a defining event for me though, it doesn't mean I'm a bad or broken person and your past actions don't make you bad or dirty either.
Don't beat yourself up for this, realise that we all do things we regret especially when young but we just don't talk about it. Quite possibly you husband has a few of his own, nobody is perfect. I don't think you should tell him either, you are pregnant and vulnerable at the moment and perhaps in need of some support from a therapist or doctor?
In an ideal world we would be able to be honest with our partners fully about everything but emotions are so unpredictable its not worth the risk to you family to tell him.
As others have said, seek help if you need it.