The chemical reactions and pathways resulting in the formation of a peptidyl serine-peptidyl glycine, or peptidyl cysteine-peptidyl glycine cross-link by the condensation of the serine hydroxyl or cysteine thiol with the carbonyl of the preceding residue and alpha-beta dehydrogenation.