I learned that it's transitive from a dictionary but i can't see any "を" before the word 思うthat's why I'm not completely convinced that it's transitive. Is it intransitive or is there exceptions?
Both「. . . と思う」and「. . . を思う」are common. But, contexts where 「と思う」occurs are much more frequent.
「somethingを思う」means "(I'm) thinking of something" or "(I'm) thinking about something". Why is this one less frequent? Because it sounds a little bit more poetic than「somethingのことを考えている」, which is prosaic.
In contrast, the other form needs a clause: 「[clause]と思う」, and means "(I) think that [clause]."
You sometimes see 「[noun]と思う」, but this one is an irregular form and I personally avoid it in writing. The corresponding regular form is 「[noun]だと思う」. For example, "Do you think we are enemies?" 「No. 友達と思う」---The more regular form is 「友達だと思う」"I think (that) we are friends."