How do I identify transistors?
General answer to your question is: you don't (as alluded to in comments by Duston). Unfortunately you really can't definitively identify anything without looking up a part number and getting a datasheet.
Even among the same type of transistor in identical packages (say, a BJT in a TO-92 package), the order of the pins can be different. I just did a quick search on &quot;TO-92 BJT&quot; and picked the first two BJTs from Mouser, which demonstrate exactly my point:
Diodes Incorporated ZTX618:

WeEn PHE13003C:

Images captured from the datasheets of the respective parts (linked above).
Unless you know the details of the specific manufacturer and part number off the top of your head, there's no definitive way to know the specifics about a particular transistor package just by visual inspection.