However, worth noting that if you are mapping to the transcriptome, you need to use a proper transcript quantification program, like salmon, kallisto or RSEM, rather than simple read counting. This is because most transcribed regions of the genome are part of multiple transcripts. This means that if you use a simple read aligner, like BWA, Bowtie2 or HISAT2 to align to the transcriptome, the vast majority of reads will map to multiple locations (and be ignored by most read counters under default settings, or counted twice under alternate settings).
If you are using a simple align and count strategy, genomic alignment can allow you distinguish a read that maps to one location in the genome, but that part is part of multiple transcripts, from a read that maps to multiple locations in the genome, and thus its identity cannot be established.
Salmon, Kallisto, RSEM etc, don't suffer this problem because the use the reads to estimate the expression using an EM model, rather than just counting reads.