I've been reading a lot of Lem these days, and just finished the Hospital of the Transfiguration, which is very unlike most of what Lem wrote. It is not science fiction but a heavy dose of realism, which takes place in a Polish psychiatric hospital while Poland was under German occupation. As Lem so often does, he creates settings that can be quite claustrophobic as he often makes use of enclosed spaces. In this case, most of the action takes place in a remote asylum filled with people suffering from various mental horrors, while outside the surrounding woodlands seem at peace, very beautiful and distant from the war. But that's only an illusion our central character Stefan finds when he discovers an electrical transmission shack that doubles as a place to stash weapons Polish partisans might use against the Nazis. Eventually, the Nazis reach closer into the story as the two worlds intersect.
The novel operates on multiple levels. The enclosed space the action takes place in is both the hospital and its surroundings as well as the central character's mind. This is an initiation story told from Stefan's point of view. The clash of beauty and madness is something he must absorb and make sense of. And thus it becomes a story of his transfiguration.
The novel was written only a few years after the young Lem survived the Nazi occupation of Lvov. And while the actions taking place are not biographical, I believe in a broad sense the spirit of the novel is both psychologically autobiographical and historically accurate.