Magnetoelectric Interactions in Mn- and Co-Doped Incipient Ferroelectrics from Density Functional Calculations