Charge transfer and martensitic nucleation