Madara read the uchiha tablet which had the recorded history of the clan written on it, he then passed down these secrets to obito in order to give him more knowledge as well as give credit to the idea that he was madara. <- This much is for sure. Now itachi learning about izanagi/izanami could've come about through one of three ways & we have no idea which one is true.
1] He read the secrets himself through the uchiha tablet, he was knowledgable enough to accomplish something like this on his own.
2] Shisui taught him, being a genjutsu master & the one who obtained the mangekyou in the first place it's likely that he read more on the tablet & passed on those secrets to itachi as he was being mentored.
3] Obito taught him, also likely seeing as he has the aforementioned experience, plus he would've been able to demonstrate the techniques to itachi firsthand seeing as he collected a stockpile of eyes after the massacre. I also believe there was some truth to what itachi said about obito being his mentor, they had a sasuke/orochimaru relationship where they had a mutual understanding but at the same time they were plotting against eachother without the other knowing.
My theory? He read the secrets on the tablet as a child, shisui taught him about the mangekyou & uchiha kinjutsus, & obito taught him how to use them through demonstration. I mean itachi spent a large amount of his life under the akatsuki, it's highly possible that obito taught him a fair amount.