Renormalization method for the onset of stochasticity in a hamiltonian system