Generally kids adjust better to any major changes the younger they are when the changes happen. You likely will attract attention at your kids' school if you transition and they either see the process or see you and the father as a same sex couple, but it isn't an insurmountable problem, and isn't usually much different than the attention garnered by being an older parent, interracial couple, someone with a lot of tattoos, etc. Kids talk.
I started transitioning openly last year, when my daughter was in 5th grade. The kids and the staff have seen me go from presenting female to presenting male, and they have seen me with a male partner, and they are aware that Leah's dad is queer. They all did a great job changing their pronouns and everything, and except for one kid calling me a "freak of nature" I haven't noticed or heard about a lot of problems from school. The main issue I have is how the kids use the word "gay" as a generic insult, but I'd be unhappy about that whether I transitioned or not.
If you hide who you are or abandon your children, it's going to be devastating for someone and possibly everyone. There's going to be hurt no matter what, but you can transition and still care for and help raise your kids, even if you don't stay with your husband.
I'm not in your situation, of course. I was a single parent and my kid was 11 when I decided I needed to admit who I was and transition. My daughter is special needs, so I was already used to not having a "normal" family, and I was getting exhausted with pretending to be a girl.
When I told her she definitely had questions. It didn't take long for her to get used to it, though - children usually love their parents no matter what they look like.