Transfer matrix in 1D Dirac-like problems