Pronunciation of /æ/, when it comes before /m/ or /n/
Solution 1:
I've never encountered or read of an accent where this allophonic vowel shift only applies in the syllable with primary stress. I'm an American English speaker with what that article calls the "nasal system" of allophonic æ-tensing (raising), and I perceive transportation to have the same vowel sound in its first syllable as hands or trance. The vowel sound in bat never appears before /m/, /n/ or /ŋ/ for me.
In general, I can't think of a vowel sound that is pronounced significantly differently based on whether it is in a syllable with primary stress or non-primary stress. Vowels in syllables with no stress at all are frequently reduced in quality—often to schwa—but vowels with secondary (or tertiary) stress are (almost by definition) not reduced that way. When /æ/ is reduced, the result is usually schwa, as in the final syllable of appliance.