Magnetars From Magnetized Cores Created by a Strong Interaction Phase Transition