Secondary dominants are based on the notion of tonicization. Tonicization is that process where a chord other than tonic is given the emphasis of a tonic function, usually through the use of a secondary dominant. In the case of secondary dominants, the temporary tonicization of a chord other than tonic usually lasts for just a few beats (thus, it's too short to be a real modulation, which we'll study later in the semester).
Secondary dominants emphasize one chord by preceding it with its dominant. The term is "secondary" because the "primary" dominant is simply V7 in the key. Secondary dominants are notated like V7/V and called "five seven of five."
Writing them: given F: V65/ii, think ii is g. V7 of g is D F# A C. V65 means that the F# should be in the bass.
Hearing them: 1) determine where you hear major-minor seventh chords, 2) determine whether they're diatonic or chromatic, 3) after determining the chromatic chords, listen to where they resolve, 4) listen carefully to the bass motion to determine the inversion. For example: you hear ??ii. Identify the ii chord, then listen to how it was approached in the bass. Say the bass moved up a half step: this means that the secondary dominant was V65/ii.
Know the chromatically altered notes:
major: V7/V = #4, V7/IV = b7, V7/ii = #1, V7/vi = #5, V7/iii = #2 and #4.
minor: (Note: for minor, "#6" means altered to be a half-step higher than the 6 indicated by the key signature, like F# in "a" minor; "b7" means the subtonic rather than the leading tone, like G natural in "a" minor); V7/V = #4 and #6, V7/ iv = #3 and b7, V7/VI = b2 and b7, V7/III = b7 and #6, V7/bVII = #6.
Know the roots: V7/V = 2, V7/IV (or iv) = 1, V7/ii = 6, V7/vi (or VI) = 3, V7/iii (or III) = 7, V7/bVII = 4.