Euclid: Cosmological forecasts from the void size function