If you have two regressions of $Y$ onto $X$, one for group $A$ and another for group $B$, you can test for a difference in regression slopes thus:
Positivist null hypothesis:
$H_{0}^{+}: \beta_{A} - \beta_{B} = 0,$ with $H_{\text{A}}^{+}: \beta_{A} - \beta_{B} \ne 0$
Test statistic for the positivist null hypothesis:
$$t = \frac{\beta_{A}-\beta_{B}}{s_{\hat{\beta}_{A}-\hat{\beta}_{B}}}$$
Where $t$ has $n_{A} + n_{B} - 4$ degrees of freedom, and $s_{\hat{\beta}_{A}-\hat{\beta}_{B}} = \sqrt{s_{\hat{\beta}_{A}}-s_{\hat{\beta}_{B}}}$ if $n_{A} = n_{B}$ as your design suggests. (And $s_{\hat{\beta}_{A}}$ and $s_{\hat{\beta}_{A}}$ are the standard errors of the slopes for $A$ and $B$.)
Obtain the p-value for $t$ thus:
$$p = P\left(|T_{\text{df}}|\ge |t| \right)$$
Reject $H^{+}_{0}$ if $p \le \alpha$.
You can (and should) also test for a equivalence of regression slopes by at least $\delta$ (the smallest relevant difference in slopes between $A$ and $B$ which you care about) thus:
Negativist null hypothesis (general form):
$H_{0}^{-}: |\beta_{A} - \beta_{B}| \ge \delta,$ with $H_{\text{A}}^{-}: |\beta_{A} - \beta_{B}| < \delta$
Negativist null hypothesis (two one-sided tests):
$H_{01}^{-}: \beta_{A} - \beta_{B} \ge \delta,$ with $H_{\text{A}}^{-}: \beta_{A} - \beta_{B} < \delta$
$H_{02}^{-}: \beta_{A} - \beta_{B} \le -\delta,$ with $H_{\text{A}}^{-}: \beta_{A} - \beta_{B} > -\delta$
Test statistics for the negativist null hypothesis:
$$t_{1} = \frac{\delta- \left(\beta_{A}-\beta_{B}\right)}{s_{\hat{\beta}_{A}-\hat{\beta}_{B}}}\\
t_{2} = \frac{(\beta_{A}-\beta_{B})+\delta}{s_{\hat{\beta}_{A}-\hat{\beta}_{B}}}$$
Where both $t$s have $n_{A} + n_{B} - 4$ degrees of freedom, and $s_{\hat{\beta}_{A}-\hat{\beta}_{B}} = \sqrt{s_{\hat{\beta}_{A}}-s_{\hat{\beta}_{B}}}$ if $n_{A} = n_{B}$ as your design suggests.
Obtain the p-value for both $t$s thus (both test statistics are constructed to be one-sided tests with upper-tail p-values):
$$p_{1} = P\left(T_{\text{df}} \ge t_{1} \right)$$
$$p_{2} = P\left(T_{\text{df}} \ge t_{2} \right)$$
Reject $H^{-}_{01}$ if $p_{1} \le \alpha$, and reject $H^{-}_{02}$ if $p_{2} \le \alpha$. You can only reject $H^{-}_{0}$ if you reject both $H_{01}^{-}$ and $H_{02}^{-}$.
Combining the results from both tests gives you four possibilities (for $\alpha$ level of significance, and $\delta$ relevance threshold):
- Reject $H_{0}^{+}$ and fail to reject $H_{0}^{-}$, so conclude: relevant difference in slopes.
- Fail to reject $H_{0}^{+}$ and reject $H_{0}^{-}$, so conclude: equivalent slopes.
- Reject $H_{0}^{+}$ and reject $H_{0}^{-}$, so conclude: trivial difference in slopes (i.e. there is a significant difference in slopes, but a priori you do not care about differences this small).
- Fail to reject $H_{0}^{+}$ and fail to reject $H_{0}^{-}$, so conclude: indeterminate results (i.e. your data are under-powered to say anything about the slopes' difference for a given $\alpha$ and $\delta$).