Hi. The only way I know to do that is to start a Peloton run workout on the app while you're on the treadmill. If you have a bluetooth heart rate monitor connected to your phone it will track some metrics like heart rate and calories but it won't track as many as if you have a Peloton treadmill. You can also run outside if you do an "outdoor" class.
I do like these but I find them a bit limiting in that you need to do a structured class and pick the duration in advance. I personally like to just run on a treadmill and listen to my own music and decide how long I want to run during my workout but those won't count as Peloton workouts.
Based on this and that I like to do other workouts like surfing and mountain biking that I want to keep track of I link Peloton to Strava and my non-Peloton workouts show up there as well so I can see all of my activities in one place. You can do the same thing with Apple Fitness and other similar apps.