In modern networks, edge computing will be responsible for processing and learning from the critical networkand user-generated data, such as wireless link usage, mobility information, application requests, and many others. The presence of Artificial Intelligence-based (AI) applications at the edge of the network will enable the network to predict necessary user behavior and its impact on network infrastructure, such as base station overloading. One of the main strategies for offloading users and base stations is to deploy UAV base stations, or flying base stations, which can dynamically provide service and connectivity. In this article, we introduce a framework for distributed learning over Multi-access Edge Computing (MEC), which manages data applications in a fully distributed setting across edge servers, thus reducing the cost of collecting user information in a centralized server. We couple the proposed distributed learning with a novel similarity metric for user trajectories, which can aggregate neural network models with similar costs as other model aggregation techniques. However, the aggregation technique can achieve much higher accuracy. Furthermore, we apply the proposed distributed learning scheme to manage and deploy flying base stations to areas that experience high demand or poor user connectivity, thus optimizing connectivity in terms of user satisfaction, delay, and network throughput.