Morphogenesis of liquid crystal topological defects during the nematic-smectic A phase transition