Let the cost of each individual undershirt be denoted as \( x \).
The total cost of buying 6 individual undershirts is \( 6x \).
According to the information provided, the cost of the 6-pack is $13.98, which is $3.96 less than the cost of buying 6 individual shirts. We can set up the following equation:
\[ 6x - 3.96 = 13.98 \]
To isolate \( 6x \), we add \( 3.96 \) to both sides of the equation:
\[ 6x = 13.98 + 3.96 \]
Calculating the right side:
\[ 13.98 + 3.96 = 17.94 \]
Now we have:
\[ 6x = 17.94 \]
Next, we solve for \( x \) by dividing both sides by 6:
\[ x = \frac{17.94}{6} \]
Calculating the division:
\[ x = 2.99 \]
Thus, the cost of each undershirt when purchased individually is \( \boxed{2.99} \).