Nonlinear-dispersive mechanism of the freak wave formation in shallow water