While this is a good article, it's off the mark for this question.
This article covers user account creation, but not course enrollments. This might help you identify who created this student account, but that would only be helpful if this is the very first encounter with your institution for this student, and that teacher created the students account as a byproduct of adding the student to their first canvas course.
My understanding of this question is more about detecting who added a student to a course which, in 95% of cases, probably, would not fall into this category (existing student or SIS imported student).
Garth's reply thread has good info on trying to identify who did the addition, but the short answer is basically:
"There's no system-tracked property, you must infer this from looking at page views of who can add students in this course, based on your roles permissions (typically teachers and/or TA's)"
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.