The implementation of joint Power-and-Index Modulation Access (PIMA), which is an effective way of realizing non-orthogonal multiple access (NOMA), requires a process of user ordering over the available subcarriers, before multiplexing their data streams for power and index modulation. The conventional way of user ordering in NOMA with respect to the channel state information can be impractical and expensive given the large numbers of users and subcarriers, in Vehicle-to-Everything (V2X) communications. Therefore, this paper proposes a novel approach that leverages K-Means clustering to learn the pattern of multi-user multi-carrier energy variations and use them to effectively order the users. For this, we develop several learning algorithms and an analytical model for the Symbol Error Probability (SEP) of PIMA, which is used to quickly generate part of the training dataset (transfer learning). The results of the comprehensive evaluations that have been carried out in this study show that the proposed approach outperforms the benchmark techniques in terms of SEP. It is also shown that the proposed scheme provides improved performance in terms of SEP as compared to distance-based ordering in realistic V2X scenarios using synthetic mobility traces for the locations of vehicles along multi-lane highways.