Second-order Teukolsky formalism in Kerr spacetime: Formulation and nonlinear source