indeed, the tools to train cascades do no more build with current opencv4, if you need those, you have to checkout the 3.4 branch
My project consist in detect cattle.
cascades are a bad idea for this, they are for rigid things, any variation in texture or pose will degrade the detection, it simply won't work.
you also should have told us, in which situation you want to detect animals, outside ? inside ? distance ? from above ? things are less universal here, than you might think.
there's a pretrained cow detector you could try with the dpm module from contrib which works nicely on outdoor scenes
you could also try pretrained cnn's like yolo or mobilenet, which have cattle classes, and optionally fine tune those with own data