Well, if the mother was exposed to either the disease or the vaccine, and she is breastfeeding the baby, then the baby will have protection (another strong argument in favor of breastfeeding babies) until they are old enough for the vaccine.
Please provide references. Last I read in the literature there was only some immunity provided. Not every mom can breastfeed. Not every mom can breastfeed enough to constantly transfer antibodies. Not every mom who breastfeeds may have antibodies to the given illness.