Multilayer networks represent multiple types of connections between the same set of nodes. Clearly, a multilayer description of a system adds value only if the multiplex does not merely consist of independent layers, i.e. if the inter-layer overlap is nontrivial. On real-world multiplexes, it is expected that the observed overlap may partly result from spurious correlations arising from the heterogeneity of nodes and partly from true interdependencies. However, no rigorous way to disentangle these two effects has been developed. In this paper we introduce an unbiased maximum-entropy model of multiplexes with controllable node degrees and controllable overlap. The model can be mapped to a generalized Ising model where the combination of node heterogeneity and inter-layer coupling leads to the possibility of local phase transitions. In particular, we find that an increased heterogeneity in the network results in different critical points for different pairs of nodes, which in turn leads to local phase transitions that may ultimately increase the overlap. The model allows us to quantify how the overlap can be increased by either increasing the heterogeneity of the network (spurious correlation) or the strength of the inter-layer coupling (true correlation), thereby disentangling the two effects. As an application, we show that the empirical overlap in the International Trade Multiplex is not merely a spurious result of the correlation between node degrees across different layers, but requires a non-zero inter-layer coupling in its modeling.