The ecological and evolutionary dynamics of large sets of individuals can be naturally addressed from a theoretical perspective using ideas and tools from statistical mechanics. This parallelism has been extensively discussed and exploited in the literature, both in the context of population genetics and in phenotypic evolutionary or adaptive dynamics. Following this tradition, here we construct a framework allowing us to derive ‘macroscopic’ evolutionary equations from a rather general ‘microscopic’ stochastic dynamics representing the processes of reproduction, mutation and selection in a large community of individuals, each one characterized by its phenotypic features. In this set up, ecological and evolutionary timescales are intertwined, which makes it particularly suitable to describe microbial communities, a timely topic of utmost relevance. Our framework leads, even in the limit of infinitely large populations, to a probabilistic description of the distribution of individuals in phenotypic space, as encoded in what we call ‘generalized Crow-Kimura equation’ or ‘generalized replicator-mutator equation’. We discuss the limits in which such an equation reduces to the theory of ‘adaptive dynamics’ (i.e. the standard approach to evolutionary dynamics in phenotypic space, which usually focuses on the mean or at most the variance of such distributions). Moreover, we emphasize the aspects of the theory that are beyond the reach of standard adaptive dynamics. In particular, working out, as an example, a simple model of a growing and competing population, we show that the resulting probability distribution can possibly exhibit dynamical phase transitions changing from unimodal to bimodal —by means of an evolutionary branching— or to multimodal, in a cascade of evolutionary branching events. Furthermore, our formalism allows us to rationalize these events as a cascade of ‘dynamical phase transitions’, using the parsimonious approach of Landau’s theory of phase transitions. Finally, we extend the theory to account for finite populations and illustrate the possible consequences of the resulting stochastic or ‘demographic’ effects. Altogether the present framework extends and/or complements existing approaches to evolutionary/adaptive dynamics and paves the way to more systematic studies of e.g. microbial communities as well as to future developments including theoretical analyses of the evolutionary process from the perspective of non-equilibrium statistical mechanics.