Perfect fluid in Lagrangian formulation due to generalized three-form field