Transfer matrices in general one-dimensional potentials