Since he was limited to 10 battalions and no planes, tanks or artillery by the treaty of Versailles, and had to hide his aerial and armoured forces in secret factories, how did he manage to train pilots and tank crews without notice?
Hitler's expansion of the Wehrmacht greatly benefited from the Weimar military (the Reichswehr) various covert attempts to abrogate the Versailles restrictions. As some of the other commentators mentioned, there were secret military schools established in the USSR for German personnel. Frequently, these individuals would "resign" from the military and enter into the USSR as private citizens.
But some of these violations did not contradict the letter of the treaty, but they did undermine the spirit of it. For example, the guiding light of the Reichswehr, Hans von Seeckt, maintained an extremely high level of training for such a small army. Seeckt's rationale was to train individual soldiers for higher duties, thus a sergeant knew a lieutenant's duties and a lieutenant trained as a captain. This meant that the Germans had an enormous pool of well-trained personnel when Hitler expanded the military. This emphasis upon training also was very technically-based as the Reichswehr prioritized technical education. Seeckt also greatly expanded the system of military attaches operating abroad. These individuals kept the military aware of developments abroad in fields Germany could not develop. Wilhelm Speidel, one of the graduates of the covert Soviet schools, spent a year in the US Army Air Corps and duly reported American aviation developments back to Berlin. Of course, the attache system paid greater dividends when the Germans partnered with other outlier powers not restricted by Versailles such as Japan or Italy.
The groundwork laid by Seeckt paid dividends when Hitler expanded the German military. However, the expansion far exceeded the one that Seeckt had planned. The friction that resulted from transitioning from planning to actual reality actually aided German rearmament. German industry was initially unprepared to deliver equipment in the quantities demanded by the Third Reich. Although the Reichswehr had inculcated German airmindedness among its officers, the nascent German aviation firms could not immediately manufacture large quantities of planes. This was part of the reason why few in the West took Hitler's opening rearmament drive, which was still secret, as seriously as hindsight demanded of them: the equipment simply was not there.
Furthermore, the general tone of Western diplomacy vis a vis military strength moved away from the Versailles program of restricted military and more towards established security quotas and force structures. The Washington Conference established a precedent with naval arms and Weimar Germany had managed to wrangle concessions from the British and French to allow the construction of the Deutschland-class armored cruisers (aka pocket battleships) to replace the aging coastal defense ships Versailles restricted to the Reichsmarine. After the initial shock of Hitler's open abrogation of Versailles in 1935, there were patchwork attempts to corral this new German military into this defense structure. Poland signed a non-aggression pact with Germany the previous year and the Anglo-German Naval Agreement of 1935 allowed for the Germans to build up to 35% of the Royal Navy's tonnage and included such previously banned items like submarines. However, the Third Reich honored these agreements as much as the Reichswehr honored the Versailles Treaty. By the time it was apparent that German rearmament could not be strangled in the cradle, the Germans had rearmed. In short, the resurgence of the German military during the Third Reich was a fait accompli.
Sources
Corum, James S. The Roots of Blitzkrieg: Hans Von Seeckt and German Military Reform. Lawrence, Kan: University Press of Kansas, 1992.
Murray, Williamson. Strategy for Defeat The Luftwaffe, 1933-1945. Maxwell Air Force Base, Ala: Air University Press, 1983.
I don't know the answer to the general question, but one really amazing aspect of interwar Germany was their development of gliders, and their use of them for training new pilots. Gliders were not prohibited by the Treaty of Versailles and seen as a loophole. Incredibly, the German glider technology was mostly developed by Theodore von Karman, a Hungarian Jewish emigre who later had to flee to the USA and worked there on rockets (he was one of the five "Martians" who had a disproportionate impact on US wartime and Cold War technology). Von Karman later claimed that he didn't realize that the German interest in gliders was meant as a way to help them train for rearmament but it is hard to imagine he didn't pick up on that.
This is discussed at length is Istvan Hargitai's The Martians of Science: Five Physicists Who Changed the Twentieth Century.
While it was secret, it certainly wasn't without notice; then-Colonel Charles Lindbergh, the US military attaché, Colonel Truman Smith, and his assistant, Captain James C. Crockett, witnessed and published several lengthy reports on the development of aerial and armoured rearmament in Germany, but their accounts were all dismissed as exaggerations and themselves were publicly denounced as German sympathisers due to their personal histories (Ex. Lindbergh had accepted a medal from Göring, Crockett had an affair with a German baroness, and Smith hated Roosevelt).
I challenge the premise that it was done without notice. Particularly in the area of aircraft the British knew exactly what was going on for years and it was a matter of public debate.