Identify the root of the triad, and identify the sharps and flats in that note's key signature. For example, in the triad C-E-G, the root is C, and there are no sharps or flats in the key of C.
Look at the middle note of the triad. Determine whether it is a minor third or a major third above the root by seeing whether it fits in the root's key signature or by counting half-steps. Four half-steps are a major third; three half-steps are a minor third.
Look at the top note of the chord, called the fifth, and determine its interval from the third. Again, count half-steps or consider the key signature, this time using the third as the key center. For example, in a C-E-G triad, recognize that the key of E major has a G#; since the triad instead has a G natural, identify the interval from E to G as a minor third, not a major third.
Put the two intervals together to identify the triad. A major third on the bottom and a minor third on top is a major triad; a minor third on the bottom and a major third on top is a minor triad. Two major thirds together are an augmented triad; two minor thirds together are a diminished triad.