Where I saw the info:
https://en.wikipedia.org/wiki/Chiang_Kai-shek#Education_in_Japan
Chiang Kai-Shek was one of many Chinese military officers that received their education at the Tokyo Shinbu Gakkou, a school that had been purpose-built by the Japanese government in 1903 in response to a diplomatic dispute involving several Chinese students attempting to attend the Seijo military academy (which at the time was a military academy primarily for domestic students). After negotiations with the Qing government, the Japanese established this Tokyo Shinbu Gakkou specifically for Chinese military students looking to study abroad.
You may wonder why the Japanese government had any interest in educating students from an apparent enemy. Indeed, several Japanese officials objected for this very reason. However, they were overruled on the basis that being able to educate some of the leading Chinese military academy students would give Japan great influence on both future leadership in both the Chinese military and political realms. Indeed, one such student was Wang Jingwei, who was a senior member of the Kuomintang that later defected and became the head of the Japanese collaborationist government in China.
Chiang Kai-Shek served as essentially a military attache/observer to a Japanese artillery battalion in Niigata, Japan as part of his IJA duties, rather than continue onto the Japanese War Academy that aspiring officers would normally pursue.
Life in the Japanese military was tough-supposedly, Chiang was very strongly influenced by his experiences in the Japanese military and wanted to create a similar atmosphere in China. While it was a little bit better for officers than it was for soldiers, ultimately aside from a very strict education and regimented training system (for soldiers, it was a comprehensive six month training regimen detailing anything from aiming weapons to feeding horses to understanding imperial ordinances) there was also an informal disciplinary system between senior officers and junior officers, consisting of hazing and essentially physical bullying. This worked all the way down into the non-commissioned ranks, and descended further into ethnic characteristics (for instance, Japanese soldiers would lord over Korean soldiers). The result was a very hierarchical and disciplined military, but this came at the cost of an increased tendency to physical violence as well as hyper-militarization of the Japanese military that would ultimately result in the crisis of the 1930s.
This is a fantastic question! It touches on some interesting imperial strategies and the surprisingly political role of military academies in this period.
Why would the Chinese send students to Japan to study and serve in the Imperial Japanese Army?
China had entered the 20th century on a wave of national humiliation. The First Sino-Japanese War in 1894-1895 and the Boxer Rebellion of 1899-1901 had shown just how far China had fallen behind the rest of the world, especially when it came to military strength. In response, the Qing Chinese government and civic organizations like Sun Yat-Sen's Revive China Society (Xingzhonghui) tried to revitalize China. Mind you, they both had different vision for what China should be revitalized as. For example, Sun Yat-Sen made people swear an oath to "expel the Manchus [i.e. the Qing] and revive China." However, both the Qing and the various subversive groups agreed China needed one thing: a better military.
Interestingly enough, the Japanese government agreed.
In 1898, General Fukushima Yasumasa of the Japanese General Staff urged Qing official Chang Chih-tung (aka Zhang Zhidong) to send young men to study in Japan as cadets. Four Chinese students enrolled in the Seijō Gakkō, the premier Japanese military prep school. The young men wen through a crash course covering the Japanese language and military science. By 1900, forty-five Chinese students graduated the Seijō Gakkō and were off to the Army Officers School or to serve in Imperial Japanese Army units as enlisted men. In 1903, the numbers had grown even larger - 106 Chinese cadets finished courses at Seijō.
Some of these students were self-supporting young men paying their own way. Others were funded by the Japanese government as a way to get Chinese students through the door.
However, this all created some concerns for the Qing government. More and more anti-Qing agitators were going to Japan to study - the Qing government wanted more control over things. In 1904, the Qing made sending students to Japan for military training explicit government policy. The Bureau of Military Training would send 100 students to Japan for four year of military studies. To help keep the students in line (and to help poorer students make the trip), the Chinese government gave the cadets full scholarships.
That's right, the Chinese government was paying the Japanese military to train Chinese soldiers!
Chinese students weren't just learning to march and shoot, either. All over Japan, young Chinese men (and a few women) were studying 20th-century skills. Hundreds of Chinese student-teachers graduated from Kōbun Institute, a school established specifically for them. In 1906, six Chinese engineers finished 3- and 4-year stints learning at at Tokyo and Osaka munitions factories. By 1907, there were 7,000 Chinese students in Japan, with an elite one percent studying at Japanese universities
But why would the Japanese train Chinese soldiers and students?
Admittedly, not everyone in the Imperial Japanese Army liked the idea. Retired Field Marshal Yamagata Aritomo was firmly against training against the idea, reasoning that Japan had already fought two recent wars in China and might one day fight a third (spoiler alert: he was right). But there were sound reasons for Japan to train Chinese officers.
First of all, some Japanese politicians and military officers wanted to create a pro-Japanese officer corps in China. The writing was on the wall by 1898: China was re-militarizing. Since that was going to happen regardless of what Japan did, Japan might as well get some benefit. By training Chinese cadets, Japan could make sure China's future officers were Japanese speakers, knew Japanese officers, and understood Japanese culture.
This wasn't an unfamiliar idea for Japan - western nations had eagerly sent military advisors to Japan in the 1860s and 1870s in the hopes off gaining influence in Japan. Numerous Japanese military officers also studied abroad. Tōgō Heihachirō, the future hero of Tsushima started his military career shelling British warships at Kagoshima in 1863. Ironically enough, he'd later spend eight years in Britain studying naval warfare. Tōgō eventually became so fluent in English he'd spend the rest of his life writing his diary in English.
In the end, this training did stick. During the Second Sino-Japanese War, many Chinese collaborators like Yang Kuiyi were graduates of Japanese military schools. I don't think the Japanese planned on creating future Quislings - the Japanese seemed more interested in creating a cohesive, pro-Japanese Chinese army. However, these defectors did prove to be a happy, if unintended future side effect of the Japanese training regime.
Secondly, training Chinese officers in Japan limited rival powers' room for influence. If China was sending students to learn in Tokyo, then those students weren't learning in Moscow, London or New York. By educating Chinese cadets, Japan widened its own sphere of influence in China while limiting the influence of other nations.
Thirdly, Japan and China had a common enemy: Russia. By 1900, Russian encroachment in Korea and Manchuria was increasingly worrying China and Japan. Around the turn of the century, segments of the Japanese leadership endorsed a pan-Asian, anti-Western philosophy - the sort of "Asian for the Asians" rhetoric that would stick around into WWII. To them, China wasn't a potential enemy, but a potential ally against Russian aggression. By creating a strong Chinese military, lead by pro-Japanese officers, the Japanese hoped to counter-balance Russian influence in Asia.
Many Chinese students in Tokyo shared this belief. Shortly before the 1904-1905 Russo-Japanese War, 150 out of the 800 Chinese students in Tokyo formed the "Resist-Russia Volunteer Corps" in 1903. Although the group disbanded before they could do anything, it gives you an idea of political sentiment at the time.
This attitude lead to some rather odd alliances between Japanese and Chinese groups. For example, in the early 1900s, Uchida Ryōhei's ultranationalist right-wing Amur River Society (aka Black Dragon Society) enthusiastically supported Sun Yat-sen's revolutionary Chinese nationalism. Today, it seems a bit odd that Chinese nationalists and the Japanese right wing ever agreed on much, but there you have it.
After the shock of the First Sino-Japanese War of 1894 -1895, Chinese leadership realised that Japan had defeated her using an army trained by western standards, and that this army was built on the foundation of western education. The Qing government, under the influence of Kang You-wei, recognised the need to modernise and in 1896, sent the first Chinese students to Japan to gain a western education. This move was widely welcomed by Japanese authorities, who saw an opportunity to improve Sino-Japanese relations. It must be understood that at the start of the twentieth century, an antagonistic relationship between China and Japan did not exist. Popular anger against Japan in China did not fully erupt until the 1919 May Fourth Movement, when the Chinese request to cancel the "Twenty-One Demands" of Japan, which affirmed Manchuria as under Japan’s sphere of influence, and the return to China of Shandong, which Japan had taken from Germany during WWI, was ignored by the Allies at the Paris Peace Conference. The establishment of a group of Japanese-educated and Japan-sympathetic elite in China was a tantalising prospect for Japan. In fact, the Japanese government actively lobbied important Chinese statesmen, for example Zhang Zhi-dong and Yuan Shi-kai, to send Chinese students to Japanese military schools. In 1898, the first group of Chinese officers arrived in Japan to enroll in military academies. The Japanese victory in the Russo-Japanese War was widely admired in China, and another wave of Chinese students arrived in Japan to study its rise as an Asian power. In 1906, the number of students in Japan reached its peak of more than 10,000.
Shinbu Gakko, established in 1903, was a preliminary school for Chinese students who were going to pursue more advanced military training in Japan. Note that it was a preliminary school - it prepared Chinese students to enter the Imperial Japanese Army Academy, the main officer academy for Japan. The school syllabus included teachings on Japanese language, history and geography, mathematics (arithmetic, algebra, geometry and trigonometry), physics and chemistry, natural science (physiology and hygiene) and drawing. The running of Shinbu Gakko was paid at the Chinese government’s expense. Chiang Kai-shek studied in Japan between April 1906 and October 1911. In March 1908 at the age of twenty-two, he entered Shinbu Gakkō with its eleventh class. Chiang graduated with an overall mark of sixty-eight out of a hundred, ranking fifty-fifth out of sixty-two students.
Another requirement for entering the Imperial Japanese Army Academy was to have practical experience in an army regiment for at least a year. This is why Chiang Kai-shek joined the 19th Regiment of Field Artillery of the 13th Division of the Imperial Japanese Army. At the start, his rank was that of a private, despite him being an officer cadet. He was later promoted to artillery leader, but was not promoted to artillery sergeant for unknown reasons, while Zhang Qun, Chiang’s Chinese friend serving in the same regiment, was promoted on October 1, 1911. Chiang never explicitly commented on his relationships with his fellow Japanese soldiers during his time in the regiment in any of his writings or speeches. However, he deeply admired the discipline of the Imperial Japanese Army. Recounting his experiences in 1940, Chiang stated:
As I saw in my days in Japan years ago, when the senior officer of the army examined bedrooms and a hall, at first they would see whether or not every corner of the room being clean and tidy, then examine the dust of backside of the door. They touched the bar of the door with white gloves. If they found dust on the gloves, the room was immediately judged not well in order and they had to clean it again. Then examining the spittoon, they had not only to see whether it was in good sanitary condition, but also to see whether water reached at the regulated level. [...] I saw here the key to successful Japanese military education.[...] The only secret of the success of education of the Japanese army lies in the fact that everything required for their whole daily life from cooking rice to washing all charged by soldiers, and need not to turn to outsiders.
Again, in 1946:
I spent one year in the regiment as mere soldier. The life was extremely monotonous and severe. At that time I felt it unreasonable because of the restriction of discipline, monotone of life and boringness. However, recollecting the past now, the basis for me to be able to live a simple life every day, to work constantly and to live a life for forty years as usual, was surely established in this one year of training as soldier. I feel that my will and spirit of revolution for my whole life thus became patient and not afraid of anything thanks to one year’s experience as soldier.
However, Chiang never entered the Imperial Japanese Army Academy, as he rushed back to China upon hearing the news of the Wuchang Uprising in 1911.
Sources:
Toward a History Beyond Borders: Contentious Issues in Sino-Japanese Relations, ed. by Yang Daqing, Liu Jie, Mitani Hiroshi and Andrew Gordon (Cambridge, Massachusetts: Harvard University Press, 2012).
Huang Ko-wu, 'Retrospect and prospect of overseas studies on Chiang Kai-shek and related topics', Journal of Modern Chinese History 5 (2011), 233-246.
Tatsuo Yamada, 'Chiang Kai-shek’s Study in Japan in His Memories', in Chiang Kai-shek and His Time: New Historical and Historiographical Perspectives, ed. by Laura De Giorgi (Venezia: Edizioni Ca’ Foscari, 2017), pp. 13-36.
Huang Zi-jin, Jiang Jieshi yu Riben: yibu jindai zhongri guanxishi de suoying [Chiang Kai-shek and Japan: A microcosm of modern Sino-Japanese relations] (Taipei: Academia Sincia, 2012).
Keishū Sanetō, Zhongguoren liuxue riben shi [A History of Chinese students in Japan] (Beijing: Joint Publishing, 1983).
Similar question: Why did the French help build the Foochow Arsenal, only to destroy it a few decades later drifting the Sino-French War.
This is a key reason why many Kuomintang generals knew that China was too weak to take on Japan militarily and required 20 years to build some type of military capacity. They studied in Japan and knew Japan's military capability. Back in those days, the Japanese civilian government was not endorsing a full scale invasion of China until militarists in the army, led by Tojo, took full control.