I'm sure the situation with each member is different, so it's hard to sum up in one way... I know that many former members still stayed on the payroll of UFP even though they technically graduated from their group, and would do occasional TV variety shows and random events. Some members separate from UFP entirely. It's a case-by-case basis.
For Momoko... did she announce which school she will be teaching at? (I'm guessing not)?
It will most likely be at a private school where they interview and do background checks on the parents before they accept their kids into their school.
I won't be surprised if Momoko ends up teaching at Horikoshi or Hinode. Most H!P members are currently at or are alumni of Hinode Middle School and High School, and UpFront has a close relationship with that school... so I bet she likely already has a job lined up at Hinode. That school has special classes for Idols, and a very strict vetting process for students. For example, when Airi went to Hinode, her classmates consisted of members from Idoling, Momoclo, AKB48, Paspo, and some other groups.
As for how to "not be harassed by fans"... I guess that also depends on what line of work they end up getting.
For example, Konno Asami is a TV news host (focused mainly on sports) for TV Tokyo, so she doesn't interact with the public that much during her work.
On the other hand, by chance, I ran into Kosuga Fuyuka (former S/mileage / ANGERME member) who was working as front-desk check-in staff at a public onsen in the Tokyo area in late 2014. That is obviously a very public-facing job. She even had her name, "小数賀芙由香" on her nametag pinned on her staff outfit.
I asked her if she had been bothered by wotas during her work, and she said "nope, everything is normal for me!".. so yeah, it is case-by-case for each member.