Spatial–temporal transformation for primary and secondary instabilities in weakly non-parallel shear flows