The cosmological evolution can be described in terms of directly measurable cosmological scalar parameters (deceleration q, jerk j, snap s, etc...) constructed out of high order derivatives of the scale factor. Their behavior at the critical temperature of the quantum chromodynamics (QCD) phase transition in early universe could be a specific tool to study the transition, analogously to the fluctuations of conserved charges in QCD. We analyze the effect of the crossover transition from quarks and gluons to hadrons in early universe on the cosmological scalars and on the gravitational wave spectrum, by using the recent lattice QCD equation of state and including the electroweak degrees of freedom. Near the transition the cosmological parameters follow the behavior of QCD trace anomaly and of the speed of sound of the entire system. The effects of deconfinement turn out to be more relevant for the modification of the primordial spectrum of gravitational waves rather than for the evolution of the cosmological parameters. Our complete analysis, based on lattice QCD simulations and on the hadron resonance gas below the critical temperature, refines previous results.