Dynamics of the sol—gel transition in organic—inorganic nanocomposites