XX1 Eagle DUB power meters are NOT compatible with Trek's BB95 mountain bike standard. Most recent (2018 - current) Trek bikes have moved away from BB95 to a compatible BB92, however it is worth measuring your bottom bracket to ensure you have a compatible setup.
BB92 is compatible.
BB95 is NOT compatible.