Advantages of experiential legacies are determined by interaction of environment and life history: A matrix-model approach