Hilbert series and operator bases with derivatives in effective field theories