Is 'immunity' to an illness acquired via a vaccinating the mom and passing it to a baby in breastmilk?

Placental vs milk. The mothers shot prior to pregnancy allows her to build immunity that will pass in the placenta to baby. Baby actually gets more immunity/pound than mom thru a placental multiplier effect. Protective levels last at least 3mo for most germs, baby shots @ 2m help bridge the gap so baby builds their own. Breast milk transfers non specific IgA that helps prevent some germs from infecting baby.
Absolutely. Vaccinating mother before or during pregnancy will give the baby temporary immunity to various illnesses but it doesn't last. Baby still need to be exposed by direct infection or vaccination to get lasting immunity.