E. coli can be transmitted to newborns during childbirth if the mother carries the bacteria in her gastrointestinal or genitourinary tract. It can also be acquired from the environment, such as through contaminated feeding equipment or through contact with individuals who have poor hygiene.