We investigate the $B+L$ violation process by performing three-dimensional lattice simulations in an electroweak theory with first-order phase transition and the electroweak sphaleron decay. The simulation results indicate that the Chern-Simons number changes along with the helical magnetic field production when the sphaleron decay occurs. Our study suggests that, for the electroweak phase transition with nucleation rate being smaller than $sim mathcal{O}(10)$, the helical magnetic field with the fractional magnetic helicity $epsilon_Mleq 0.2$ can be probed by Cherenkov Telescope Array through the intergalactic magnetic field measurements. Based on our numerical results, we suggest a method to probe the baryon asymmetry generation of the Universe, which is a general consequence of the electroweak sphaleron process, through the astronomical observation of the corresponding helical magnetic field.