An incredible innings from Ben Stokes helped England defeat New Zealand by 181 runs to take a 2-1 lead in the four-match series.