You can check the documentation:
https://www.statsmodels.org/dev/generated/statsmodels.tsa.arima_model.ARIMA.html
that shows the formula used:
If exogenous variables are given, then the model that is fit is
ϕ(L)(y(t)−X(t)β)=θ(L)ϵ(t)
where ϕ and θ are polynomials in the lag operator,
L. This is the regression model with ARMA errors, or ARMAX model. This
specification is used, whether or not the model is fit using
conditional sum of square or maximum-likelihood, using the method
argument in statsmodels.tsa.arima_model.ARIMA.fit. Therefore, for now,
css and mle refer to estimation methods only. This may change for the
case of the css model in future versions.
If you click on 'source' you can see the source code.