Probably with a helper entity.
I had the same question with a PIR sensor in my basement and spent a day trying to write an automation in Home Assistant, then gave up and did it in the Node Red add-on with four nodes.
If you want to go with Node Red, here is the flow.
[{"id":"7e9a7e566f624b77","type":"server-state-changed","z":"b4d57b7976516af6","name":"Workshop PIR","server":"cc0d1734.6963a8","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.workshop_pir_pir","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":980,"wires":[["79fce5c5419a5433","298920f7359f7829"],[]]},{"id":"79fce5c5419a5433","type":"stoptimer-varidelay","z":"b4d57b7976516af6","duration":"10","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"","reporting":"every_second","persist":false,"ignoretimerpass":false,"x":400,"y":1040,"wires":[["bf8dbceae8f8e91b"],[],[]]},{"id":"298920f7359f7829","type":"api-call-service","z":"b4d57b7976516af6","name":"","server":"cc0d1734.6963a8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.utilityroom_light_2"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":620,"y":980,"wires":[[]]},{"id":"bf8dbceae8f8e91b","type":"api-call-service","z":"b4d57b7976516af6","name":"","server":"cc0d1734.6963a8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.utilityroom_light_2"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":620,"y":1040,"wires":[[]]},{"id":"cc0d1734.6963a8","type":"server","name":"Home Assistant- Raspberry","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
The magic is in the Timer Node. Every time the PIR detects movement, it turns on the light and resets the timer to 10 minutes. If there is no movement for ten minutes the light turns off.
If someone has a Home Assistant automation solution, I would like to see it too.