Text this: Learning the best nanoscale heat engines through evolving network topology