The electroweak Hamiltonian in the gradient flow formalism