Collective transverse cavity cooling of a dense molecular beam