Symmetry breaking in nematic liquid crystals: analogy with cosmology and magnetism