the constants are derived from the critical point of the fluid.
the critical point is the pressure and temperature of the fluid at which the liquid state cannot be differentiated from the gaseous state.
if you plot a P-T graph, you will find that the critical point corresponds to the point of inflexion:
dP/dT = 0 and d2P/dT2 = 0.
By differentiating the VDW equation to find the first-order and second-order differentials, and plugging in the critical point values, the constants a and b are derrived.