My understanding was that breast milk (at least in humans) gave the baby antibodies, but not the ability to create those antibodies. So, the effect wouldn't last.
Some theorize the baby needs the mother's poop, to start it's own digestive microbiome. It works that way in other species, but I don't know if it's more than speculation for humans.
You also need a skin microbiome, but you can get that later.