Flexible extension of the accelerated failure time model to account for nonlinear and time-dependent effects of covariates on the hazard