Going by what Luke wrote at 1v26; 2v4,39 Luke does Not call Nazareth a village but always as a 'city'. Close by was Sepphoris an important fortified city having a district court [Sanhedrin] so Nazareth was convenient to trade routes and main cities, so with that proximity the people would have had ready information available to them in order to learn. Luke 4vs16-23.
As Jesus grew up according to Luke 2v52 Jesus progressed,
and it was his family's custom to attend the local synagogue each week.
Mt 13v55,56; Luke 4v16. Since Mary knew Scripture she would have also taught what she knew to Jesus and his half brothers and sisters.
Since wax-coated writing tablets were available even Mary could have used them to teach reading and writing to all her children.
As far as Jesus learning in Jerusalem, there is a good indication at Luke 1v42,46 Jesus was already listening and questioning the spiritually older men in Jerusalem when he was very young.
Regardless of what the author of Luke describes Nazareth, we know that during the time of Jesus, it was a hamlet. Simply, they were off the beaten path. It consisted of a small population of peasants, the lower class. It was nothing much.
Yes, it close to Sepphoris, but that would not necessarily mean that he had access to education. If we look at the work that his father was doing (and it was most likely that he followed in those footsteps for at least a little while), he was a tekton. He was of the lower class, a person who was easily replaceable.
When he is addressed by the term tekton (or when it is referenced to his father), it is a sign of just how lowly he was considered. To make somewhat of a comparison, it would be like saying, "isn't that the bum? How could he amount to anything. (Just to make it clear though, I'm not saying Jesus was the equivalent to a bum)" When reading Mark 6:3, or Matthew 13:55, the people are replying out of surprise. That is because they are shocked that someone of such a lowly stature is able to accomplish what he is doing.
The reason this is important is to show that Jesus was lowly, he was of the lower class, and really didn't have the means to do anything but survive. Especially considering that Sepphoris and Tiberius were so close to Nazareth. Basically, the two cities would have made the life of a peasant even harder and they would have drained the resources of the country side. In this historical reference, it is quite likely that Jesus was similar to a modern day handyman. Not exceptionally skilled, but was able to repair various tools or do patchwork on a house, etc. He most likely was paid enough to survive.
Looking at that, I think it is highly unlikely he would have had any time to really focus on learning. He was most likely fighting to survive. That was part of being in the social class that he was in. The Gospels really don't give us much reason to doubt that.
Maybe later on in his life, he did study somewhat. There is that possibility, and it is logical. We are missing a large portion of his life. He most likely worked during that time, and possibly, getting closer to the time of his ministry, went out and studied. I would personally say that he studied under John the Baptist, and actually go as far as saying that he was most likely a disciple of his. That is nearly the only logical reason why John would have baptized Jesus.
However, the Gospels offer no credible evidence that Jesus could read or write. We have a passage in Luke speaking of him reading in a synagogue that didn't exist, passages that simple could not have been read in the fashion the story states, and then being threatened to be thrown off a cliff that exists, but is too far off to actually relate to the Biblical story. That is why I personally lean towards the idea that he was illiterate. That and that the majority of the population by far were illiterate. This does not mean he was unintelligent in anyway, just that he lacked the skills of reading and writing. Which I don't think would have greatly been needed by him. He lived in an oral culture.
As for Jesus teaching in the Temple when he was of a young age. The story is highly unlikely. The primary reason being that we have just a single attestation to it. The other Gospels do not mention this event at all. More so, knowing the family status, that they were lowly and impoverished, it is very unlikely they had the means to actually make the trip every year to Jerusalem. During the 1st century, the fact was that many Jews simply did not make the trip as they could not.
I'm in no way trying to belittle the intelligence of Jesus. For his time, I do see him as being a wise person.