The use of two-wheelers (TWs) has gained popularity as an alternative to personal vehicles due to their flexibility, fuel economy, ease of parking, and size, especially in congested cities. However, TWs are considered vulnerable road users due to their higher riding risk compared to other modes. This study proposes a novel framework to extract latent and dependent heterogeneous risk factors that affect the crash severity of TWs. By combining eXtreme Gradient Boosting (XGBoost) and SHapley Additive exPlanation (SHAP) analysis, this study investigates the factors affecting TW crash severity, providing both local and global interpretability. The XGBoost method is employed to model crash severity, while SHAP analysis facilitates the derivation of explanations from the model, enhancing our understanding of the contributing factors. The French crash dataset for TWs between 2014 and 2017 is utilized for this analysis. The findings highlight that the department of the crash, road category, urbanization level, TW category, and age of the user significantly influence TW crash severity. Furthermore, severe injuries are more likely to occur in TW crashes associated with rural areas, older riders, riders not wearing helmets, run-off-road crashes, and crossing roads. The insights derived from this study can be leveraged to develop targeted interventions that address the identified risk factors and promote the safety of TW riders. By focusing on these key factors, policymakers and stakeholders can implement effective measures to reduce the severity of TW crashes and enhance the overall safety of TW users.