Canonical Correlation Analysis is a technique in multivariate data analysis for finding linear projections that maximize the correlation between two groups of variables. The correlations are typically defined without accounting for the serial correlations between observations, a typical setting for time series data. To understand the coupling dynamics and temporal variations between the two time-varying sources, we introduce the time-dependent canonical correlation analysis (TDCCA), a method for inferring time-dependent canonical vectors from multilevel time series data. A convex formulation of the problem is proposed, which leverages the singular value decomposition (SVD) characterization of all solutions of the CCA problem. We use simulated datasets to validate the proposed algorithm. Moreover, we propose a novel measure, canonical correlation variation as another way to assess the dynamic pattern of brain connections and we apply it to a real resting state fMRI dataset to study the aging effects on brain connectivity. Additionally, we explore our proposed method in a task-related fMRI to detect the temporal dynamics due to different motor tasks. We show that, compared to extant methods, the TDCCA-based approach not only detect temporal changes but also improves feature extraction. Together, this paper contributes broadly to new computational methodologies in understanding multilevel time series.