Anomalous structure transition in undercooled melt regulates polymorphic selection in barium titanate crystallization