If the book has not a DRM and you are free to edit/convert it, you can use Calibre to convert to the same format (i.e. you can use an .epub as a source file and still convert to an .epub output.
In the Heuristic processing tab make sure to enable both the processing and Remove unnecessary hyphenation; if you want you can also enable other options here if ...
Hyphenating a text that is not in a fixed presentation (page shape, or
ratio page size/ font size) makes little sense as the words may change
position on a line. Hence, I am assuming that what you are asking is how
to automatically do soft hyphenation, so that the reader of the file can
modify the font size and still get proper hyphenation where needed.
Like all new CSS specifications, hyphenation is a mess. I spent hours trying to disable hyphens in my titles for an Epub file viewed in Microsoft Edge. I've finally found a solution.
My reference comes from this MDN entry, but you need to note (in typical Microsoft fashion) that the presentation is only complete in its examples, not in its definition.
This may or may not be an answer to the question I posed.
"EPUB 3 CSS Profile includes epub prefixed versions of the following properties from the CSS":
The -epub-hyphens property does not include support for the value all....
Such hard hyphens are usually the result of a bad conversion from pdf to epub/mobi. I got them in books I regularly bought, so it's not a problem of piracy: my impression is that even today publishers start with a pdf file (made with InDesign or similar), and they forgot that some words are hyphenated.
If the book had no DRM, sometimes I decided to use Sigil ...