The three-dimensional momenta of quarks inside a hadron are encoded in transverse momentum-dependent parton distribution functions (TMDs). This work presents an exploratory lattice QCD study of a TMD observable in the pion describing the Boer-Mulders effect, which is related to polarized quark transverse momentum in an unpolarized hadron. Particular emphasis is placed on the behavior as a function of a Collins-Soper evolution parameter quantifying the relative rapidity of the struck quark and the initial hadron, e.g., in a semi-inclusive deep inelastic scattering (SIDIS) process. The lattice calculation, performed at the pion mass m_pi = 518 MeV, utilizes a definition of TMDs via hadronic matrix elements of a quark bilocal operator with a staple-shaped gauge connection; in this context, the evolution parameter is related to the staple direction. By parametrizing the aforementioned matrix elements in terms of invariant amplitudes, the problem can be cast in a Lorentz frame suited for the lattice calculation. In contrast to an earlier nucleon study, due to the lower mass of the pion, the calculated data enable quantitative statements about the physically interesting limit of large relative rapidity. In passing, the similarity between the Boer-Mulders effects extracted in the pion and the nucleon is noted.