school biology teaches me that all living things need to breathe.
Yes: all living animals on Earth need to breathe. It's worth noting that even on Earth, some animals breathe in a different way from others (fish take in oxygen from water using their gills, while e.g. mammals and birds take in oxygen from air using their lungs) and some living creatures 'breathe' in different chemicals from others (animals inhale oxygen and exhale carbon dioxide; with plants it's the other way round).
All living beings - animals, plants, and others - that are known to humans live, of course, on Earth. Our knowledge of biology is restricted to those creatures that can survive on this carbon-rich, oxygenated planet. Why on earth would space-dwelling giant slugs need to have respiratory systems even remotely similar to Earth-dwelling creatures?
Wookieepedia also confirms that they can survive in vacuum:
They were silicon-based lifeforms that survived in the vacuum of space by making their homes in the caverns and craters of asteroids.
Silicon-based is already enough to make them sound very different from any Earth beings. The notion of silicon-based lifeforms has been investigated in this article, which says:
Life-forms must also be able to collect, store, and utilize energy from their environment. In carbon-based biota, the basic energy storage compounds are carbohydrates in which the carbon atoms are linked by single bonds into a chain. A carbohydrate is oxidized to release energy (and the waste products water and carbon dioxide) in a series of controlled steps using enzymes. [...]
Wherever astronomers have looked – in meteorites, in comets, in the atmospheres of the giant planets, in the interstellar medium, and in the outer layers of cool stars – they have found molecules of oxidized silicon (silicon dioxide and silicates)
In other words, the necessity of oxygen for living is a property of carbon-based lifeforms, while silicon-based ones might be able to survive based on the silicon traces found in meteorites and by extension asteroids.