The modification process that results in the conversion of lysine, carried by a specialized lysine-accepting tRNA (possessing a CUA anticodon), to pyrrolysine (a lysine with an amide linkage to a (4R,5R)-4-substituted pyrroline-5-carboxylate).