This isn't information that one extracts, since it's not held within the BAM files. Instead your steps will be:
- Determine where transcripts and exons are (e.g. with stringTie).
- Process the resulting GTF file to retrieve introns (using whatever definition of this you'd like).
The second step may require some custom code, depending on whether you want introns that overlap exons (e.g., due to having multiple transcripts for a gene) or not.