IN Japan, August is a month for memories. On Tuesday Hiroshima remembered its atom-bomb victims. On Friday Nagasaki does the same. Next Thursday, at noon, the whole nation will observe a minute of silent prayer, commemorating the end of the war that, at Pearl Harbor, Japan pulled the United States into 50 years ago.In Tokyo, the political and economic fallout from stock market and other scandals continues. Today, even Japanese of modest means live far better than in the days of hunger and deprivation following the war. But the stock market is depressed, deserted by small investors angry at dealers who reimbursed only large customers for losses, not the little fellow. And the political ripples from this and other scandals spread. If, for Americans, the '80s were the decade of the "Bonfire of the Vanities," a somewhat similar psychology was at work in Japan. Individuals and companies succumbed to the siren call that money was just waiting to be made, if only they pushed the right levers. Spiraling land and share prices drew widening circles of people into the money game - until the bubble burst. Reactions have been twofold. To some people, it's just the same old story. Banks, securities firms, big corporations, bureaucrats, and politicians are all in cahoots with each other, sampling sea urchins in elegant teahouses or swinging their clubs on expensive golf courses. Even a geisha friend of the finance minister is somewhere in the picture. In the background lurks the yakuza, the Japanese crime syndicates, muscling into legitimate businesses and being helped by henchmen of establishment figures. To others, the same old story is being repeated, but with a difference. No one likes to wash his dirty linen in public, but the past couple of years of scandals involving politicians, businessmen, bureaucrats, the media, policemen, and the underworld are having a cumulative effect. It's not enough for the Japanese to boast that they have built up the world's most efficient car and electronics industries. (Almost all of their $40 billion trade surplus with the US comes from exports of these two categories.) Or that their children get top scores in mathematics, or that Japan is still generally a safe, nonviolent society. IN talk show after talk show, editorial after editorial, there is wide agreement on the direction in which Japan must go: a fairer, more transparent society, a society ruled by laws applicable to all and not by a government of winks and nods. There is a growing recognition that, while all nations are different in some degree from each other, Japan cannot ask for untrammeled access to major world markets without significantly opening up its own. It can't have a stock market significantly different from th ose of its major partners. And, while the point is still controversial, most people know that Japan cannot forever keep its doors closed to neighboring Asian workers. The Gulf war showed that, when it came to dealing with naked armed aggression, there was no substitute for American military might. Japan was the world's second richest power, but how could its economic strength be used to assert leadership in the global community? Did the Japanese even want such leadership? If the answers so far seem timid or confusing, it is because the questioning has only recently moved from theory to urgent need. One sign of new thinking: Japanese minesweepers are in the Persian Gulf. They got there last and are prepared to stay longest, disposing of mines others did not have time to reach, and accepting the responsibility that if a commercial ship strikes a mine later on, they will be the ones to blame. Another sign: For decades, commemorations at Hiroshima centered on the Japanese as victims. But a couple of years ago, a major Japanese television network showed Hiroshima bomb victims asking forgiveness from Southeast Asian victims of Japanese wartime atrocities. This year, for the first time, the mayor of Hiroshima explicitly apologized for his country's misdeeds. Japan's own version of glasnost and perestroika has not been spectacular. But changes in consciousness are going on, mostly without quite breaking through to the surface. The evidence does not justify overweening confidence. But neither is it cause for cynicism.