I don’t think a combined loss function is necessarily needed and would probably see both tasks independently using different model outputs (with a shared “root” model) and with an own criterion.
E.g. you could create two different “heads” (e.g. classification layers) while reusing the same feature extractor, return the logits for both tasks separately and train the model using both losses.