In a type-II superconductor the generation of higher harmonics in the magnetic response to an alternating magnetic field is a consequence of the non-linearity in the I-V relationship. The shape of the current-voltage (I-V) curve is determined by the current dependence of the thermal activation energy U(J) and is thus related to the dynamical regimes governing the vortex motion. In order to investigate the vortex dynamics in MgB2 bulk superconductors we have studied the fundamental (chi1) and third (chi3) harmonics of the ac magnetic susceptibility. Measurements have been performed as a function of the temperature and the dc magnetic field, up to 9 T, for various frequencies and amplitudes of the ac field. We show that the analysis of the behaviour in frequency of chi3(T) and chi3(B) curves can provide clear information about the non-linearity in different regions of the I-V characteristic. By comparing the experimental curves with numerical simulations of the non-linear diffusion equation for the magnetic field we are able to resolve the crossover between a dissipative regime governed by flux creep and one dominated by flux flow phenomena.