How can I get an algorithm to have an evalutation metric based on aggregate predictions?
I don't care whether individual predictions are accurate


If this is true (which I don't think it is), then you could just take the group mean of the target for males and females to minimize the RMSE and make this your prediction for all male and female individuals, respectively. (Basically a model where Gender is the only feature if you insist on using xgboost.) One could argue that this one-feature model might not generalize as well to new data than a model with more features, but if Gender is not in any meaningful way related to the target you can't optimize the RMSE towards Gender anyway. 

Based on your "Note" I assume you somehow want both, good predictions for individuals and on the group level. In this case minimizing the normal "individual-level" RMSE is already the best way to go.