A General Bernstein--von Mises Theorem in semiparametric models