Locoweed is a collective name for a variety of plants, such as Oxytropis and Astragalus L. When these plants are infected by some fungi or endophytes, they will produce an alkaloid (swainsonine) that is harmful to livestock. Chronic toxicity characterized by neurological disorders occurs in livestock overfed on locoweed, and swainsonine (SW) is considered a major toxic component. The mechanism of the SW synthesis of endophytic fungi from locoweed remains unknown. In order to further discover the possible synthetic pathway of SW, in this study, a mycotoxin (SW) producer, Alternaria oxytropis isolate, UA003, isolated from Locoweed plants, and its mutant were subjected to transcriptomic analyses to ascertain the genes involved in the synthesis of this toxin. Mutant strain A. oxytropis E02 was obtained by ethyl methanesulfonate (EMS) mutagenesis treatment, and the strains were sequenced with different culture times for transcriptomic analysis and screening of differentially expressed genes. The results show a highly significant (p < 0.01) increase in SW yield in the A. oxytropis E02 strain obtained by EMS mutagenesis treatment compared to A. oxytropis UA003. A total of 637 differentially expressed genes were screened by transcriptome sequencing analysis, including 11 genes potentially associated with SW biosynthesis. These genes were screened using GO and KEGG data annotation and analysis. Among the differential genes, evm.TU.Contig4.409, evm.TU.Contig19.10, and evm.TU.Contig50.48 were associated with L-lysine biosynthesis, the L-pipecolic acid pathway, and the α-aminoadipic acid synthesis pathway. This study provides new insights to elucidate the mechanism of SW synthesis of endophytic fungi in locoweed and provides data support for further exploration of A. oxytropis genomics studies.