I would suggest one of two choices. The first option, as suggested by Jim Reynolds in the comments above, would be:
I'm a teacher by training.
This is the standard idiomatic way to say that you've studied (and, typically, by implication, completed your studies) for a particular occupation.
You could substitute "by education" for "by training" here, if you really wanted to, but at least to my ear, that doesn't sound quite as common or natural.
(I decided to check my intuition with Google Ngram Viewer, and it seems to generally agree, ranking "X by training" above "X by education" over the last 100 years or so.
Interestingly, refining the query shows that the this idiom seems to be most often applied to a few specific professions, the top two being "a lawyer by training" and "an engineer by training". As these are both well-known examples of professions where a formal degree is an essential and often legally mandated requirement for practice, this is perhaps not so surprising.)
As Jim points out, using this expression can sometimes carry the implication that you have not actually yet worked, or do not currently work, in the profession that you studied for. This does not really have anything specifically to do with the idiom as such — it's simply that, with the explicit qualifier "by training" included in the sentence, the reader may assume that the qualifier is actually necessary, and that therefore, by implication, you are not (currently) a teacher in some other sense.
Generally, you don't need to worry about this too much, since the intended meaning should be clear from context, anyway. That said, if you wish to make it absolutely unambiguous that the reason you're stressing the "by training" part is to put emphasis on your formal degree in the subject, I would suggest simply rewriting the sentence to explicitly say so:
I have a degree in pedagogy.
Of course, you should substitute the specific official (English) name of the degree you have, and perhaps include the name of the institute you received it from