Mental-health issues are difficult to identify in their early stages within online platforms because of the complexity, inconsistency, and narrative character of user-generated text. The development of natural-language processing (NLP) and transformer architectures opens new possibilities for large-scale automated detection of psychological distress signals. In this context, the present work constructs a computational pipeline that classifies real-world mental-health forum posts as indicating anxiety or depression—two clinically distinct yet linguistically overlapping conditions. The proposed end-to-end system, ProStack-MH (Probabilistic Stacking for Mental-Health Text Classification), combines rigorous dataset cleaning, noise elimination, staff-content removal, semantic text normalization, transformer-friendly preprocessing, class-balancing, and user-level data partitioning to prevent leakage. ProStack-MH stacks two complementary transformer encoders—roberta-base and distilroberta-base—whose softmax probability vectors are concatenated and passed to a lightweight Logistic Regression meta-learner. Six baselines are evaluated under a strict leakage-free, user-wise test split: classical TF-IDF + LR/SVM, BiLSTM, DistilBERT, MentalBERT, DeBERTa, and RoBERTa-base. Model behaviour is explained post-hoc using SHAP feature attributions and GoEmotions-based affective profiling. An ablation study confirms that the stacking step—rather than either base learner alone—drives the improvement. ProStack-MH achieves 93.38% accuracy, F1 = 0.9302, MCC= 0.8674, and ROC-AUC= 0.98, outperforming all baselines on every metric. This framework provides a reproducible methodological foundation for computational mental-health monitoring, risk screening, and early-intervention research.