A hierarchical Bayesian framework for nonlinearities identification in gravitational wave detector outputs