A sociologist was someone who studied sociology.
A sociologist named Lindstrom was assigned to the USS Enterprise in 2267, and assisted Captain Kirk in his dealings with the people of Beta III. After Kirk destroyed the computer Landru (which was keeping the society of Beta III stagnant and unchanged), Lindstrom remained behind with a team of experts to help guide the civilization back to a healthier form. (TOS: "The Return of the Archons")
Leeta was described as an amateur sociologist by Julian Bashir after the Bajoran woman explained the role of Trill Guardians to Odo in 2371. Leeta explained that she found it a useful avenue of study for a dabo girl like herself, as it helped her to understand her customers better. (DS9: "Facets")