A general formulation of topology optimization for nonlinear materials incorporating internal variables by the continuous adjoint method