We consider random non-directed Erdős–Rényi networks subject to a dynamics conserving vertex degrees and study analytically and numerically equilibrium three-vertex motif distributions in the presence of an external field coupled to one of the motifs. For small magnitude of the external field the numerics is well described by chemical kinetics equations based on the law of mass action for the concentrations of motifs. For larger external fields a transition into a state with some trapped motif distribution occurs. We explain the existence of the transition by employing the notion of the entropy of the motif distribution and describe it in terms of a phenomenological Landau-type theory with a non-zero cubic term. We argue that the localization transition should always occur if the entropy function is non-convex. We conjecture that this phenomenon may be the reason for motifs' pattern formation in real networks.